diff --git a/html/config/calibrate.php b/html/config/calibrate.php new file mode 100644 index 0000000..d9edfc3 --- /dev/null +++ b/html/config/calibrate.php @@ -0,0 +1,45 @@ +"; +//$cmd = 'ping 127.0.0.1'; + +system("sudo pkill ocean_optics_calibration_console"); +system("sudo gpio write 1 1"); +$cmd=""; + + + + +if ($a==1) +{ + $cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console -t 30 -slfs ocean_optics.lmp --cfon FSNsdfsd'.$a.'.data -p '.$a; +} +else +{ + $cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console -t 30 -slfs 4000nit.dat --cfon FSNsdfsd'.$a.'.data -p '.$a; +} + + + + +while(@ ob_end_flush()); + +$proc = popen($cmd, 'r'); + + +while(!feof($proc)){ + echo fread($proc, 4096); + @ flush(); +} +echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'; +echo '回到首页'; \ No newline at end of file diff --git a/html/config/location.php b/html/config/location.php new file mode 100644 index 0000000..4dd8476 --- /dev/null +++ b/html/config/location.php @@ -0,0 +1,48 @@ +定标

'; +echo '回到首页'; + +/* +$i = 100; +while ($i<1000) { + ++$i; + //部分浏览器需要内容达到一定长度了才输出 + if ($i === 103) { + echo"

hello word".$i."

";; + } else { + echo"

hello word".$i."

";; + } + sleep(1); + +} +*/ diff --git a/html/config/position.html b/html/config/position.html new file mode 100644 index 0000000..c13621f --- /dev/null +++ b/html/config/position.html @@ -0,0 +1,15 @@ + + + + + Title + + +位置1 +位置2 +位置3 +位置4 +位置5 +位置try + + \ No newline at end of file diff --git a/othersoft/install.sh b/othersoft/install.sh new file mode 100644 index 0000000..d205631 --- /dev/null +++ b/othersoft/install.sh @@ -0,0 +1,15 @@ +mkdir build +cd build +mkdir movingliner +cd movingliner +cmake ../../movingliner +make -j4 +mkdir /home/pi/bin +cp ./movingliner /home/pi/bin +echo beging build shuttercali +cd ../ +mkdir shuttercali +cd shuttercali +cmake ../../shuttercali +make -j4 +cp ./shuttercali /home/pi/bin diff --git a/othersoft/movingliner/CMakeLists.txt b/othersoft/movingliner/CMakeLists.txt new file mode 100644 index 0000000..afdac17 --- /dev/null +++ b/othersoft/movingliner/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.0) +project(movingliner) +IF (WIN32) + + #MESSAGE(STATUS "Now is windows") + +ENDIF () +set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} C:/Qt/Qt5.12.7/5.12.7/mingw73_64) +#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} C:/Qt/Qt5.9.0/5.9/msvc2017_64/ ) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(QT Core Gui Network WebSockets SerialPort Widgets) + +find_package(Qt5 REQUIRED ${QT}) +include_directories("source/LinearShutter") +add_executable(movingliner + main.cpp + source/LinearShutter/VSMD12XControl.cpp + source/LinearShutter/VSMD12XControl.h + source/LinearShutter/ZZ_SeiralPort.cpp + source/LinearShutter/ZZ_SeiralPort.h + + ) +qt5_use_modules(movingliner ${QT}) + + + + + diff --git a/othersoft/movingliner/DeviceSettings.ini b/othersoft/movingliner/DeviceSettings.ini new file mode 100644 index 0000000..2f87a5b --- /dev/null +++ b/othersoft/movingliner/DeviceSettings.ini @@ -0,0 +1,27 @@ +[DEVICE INFO] +TotalSpectrometer=1 +[FS2] +Model=ISIF +Port=/dev/ttyS1 +UID=QEP02975 +[FS1] +Model=OSIFAlpha +Port=-1 +UID=QEP02975 +AEMax=0.85 +AEMin=0.80 +Depth=200000 +[FS3] +Model=Null +[LINEAR SHUTTER] +Port=COM12 +Type=1 +DCID=1 +TotalPosition=5 +Position0=10000 +Position1=91947 +Position2=219299 +Position3=347535 +Position4=474904 +[HUMITURE] +Port=/dev/ttyUSB3 \ No newline at end of file diff --git a/othersoft/movingliner/main.cpp b/othersoft/movingliner/main.cpp new file mode 100644 index 0000000..279f59b --- /dev/null +++ b/othersoft/movingliner/main.cpp @@ -0,0 +1,52 @@ +#include +#include +#include +#include "qtextstream.h" +QTextStream cout1(stdout, QIODevice::WriteOnly); +void logout(QString str){ + std::cout<"; + std::fflush(stdout); +} +int main(int argc, char *argv[]) { + int aaa=1000; + QString str(argv[1]); + QCoreApplication a(argc, argv); + CVSMD12XControl Motercontrol; + QString m_qstrDeviceConfigFilePath; + // cout1<<"adfasdfsadfsd"<"<value("LINEAR SHUTTER/Position"+str).toLongLong(); + if (positon==0) + { + logout("Can not Find the position<\/b>"); + return 0; + } + cout1<<"Find Configfile in "< The Port of Motor is "<value("LINEAR SHUTTER/Port").toString()<<"
"<value("LINEAR SHUTTER/Position"+str).toLongLong()<<"
"<"<value("LINEAR SHUTTER/Port").toString() + Motercontrol.ILMES_InitializeComm(m_qsDeviceConfig->value("LINEAR SHUTTER/Port").toString()); + ControllerParams cpTest; + Motercontrol.ILMES_InitializeParams(cpTest); + + + + + logout("Moving to Zero"); + Motercontrol.StartBackZero(); + //std::cout<<"beging to move position"; + logout("Moving to The Position"); + Motercontrol.MoveTo(positon); + + logout("Finish the Task!!!<\/b>
Thanks For Using<\/b>"); + return 0; + // return QCoreApplication::exec(); +} diff --git a/othersoft/movingliner/source/LinearShutter/AbstractPort.h b/othersoft/movingliner/source/LinearShutter/AbstractPort.h new file mode 100644 index 0000000..0c0118b --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/AbstractPort.h @@ -0,0 +1,16 @@ +#pragma once +#include "VSMD12XMiscDefines.h" +#include +class CAbstractPort +{ +public: + virtual void InitPort(PortInfo portinfo) = 0; + virtual bool SetPort() = 0; + virtual bool Open() = 0; + virtual void Close() = 0; + + virtual std::string ReadAll(int waite=5000) = 0; + virtual int Write(const std::string strSend) = 0; + +}; + diff --git a/othersoft/movingliner/source/LinearShutter/VSMD12XControl.cpp b/othersoft/movingliner/source/LinearShutter/VSMD12XControl.cpp new file mode 100644 index 0000000..520e487 --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/VSMD12XControl.cpp @@ -0,0 +1,1416 @@ +#include "pch.h" +#include "VSMD12XControl.h" +#include "ZZ_SeiralPort.h" +#include +#define sprintf_s snprintf +CVSMD12XControl::CVSMD12XControl() +{ + m_iProtocolType = 0; + m_iCID = 1; + m_bIsSyncMove = 0; + m_piPositionInPulses = NULL; + waitetime = 200; + waitetime = 200; +} + +CVSMD12XControl::~CVSMD12XControl() +{ + if (m_piPositionInPulses!=NULL) + { + delete[] m_piPositionInPulses; + } +} + +bool CVSMD12XControl::ILMES_InitializeComm(PortInfo portinfo, int iPortType /*= 1*/, int iCID /*= 1*/, bool bSyncMove /*= true*/) +{ + SetProtocolType(iPortType); + SetCID(iCID); + SetSyncMode(bSyncMove); + + return InitAndOpenPort(portinfo); +} +bool CVSMD12XControl::ILMES_InitializeComm(QString portName, int bandrate, int iPortType , int iCID , bool bSyncMove ) +{ + PortInfo pi; + pi.FullPortName = portName; + + pi.iBaudRate = bandrate; + return ILMES_InitializeComm(pi, iPortType, iCID, bSyncMove); + + +} + +bool CVSMD12XControl::ILMES_InitializeParams(ControllerParams cpParams) +{ + bool bRes = false; + + bRes = CVSMD12XControl::SetBaudRate(cpParams.bdr); + if (!bRes) + { + qDebug() << "SetBaudRate Err"; + //return false; + } + + bRes = CVSMD12XControl::SetSpeed(cpParams.spd,cpParams.acc,cpParams.dec); + if (!bRes) + { + qDebug() << "SetSpeed Err"; + //return false; + } + + bRes = CVSMD12XControl::SetMicroSteps(cpParams.mcs); + if (!bRes) + { + qDebug() << "SetMicroSteps Err"; + //return false; + } + + bRes = CVSMD12XControl::SetCurrent(cpParams.cra,cpParams.crn,cpParams.crh); + if (!bRes) + { + qDebug() << "SetCurrent Err"; + //return false; + } + + bRes = CVSMD12XControl::SetZeroParams(cpParams.zmd,cpParams.osv, cpParams.snr,cpParams.zsd,cpParams.zsp); + if (!bRes) + { + qDebug() << "SetZeroParams Err"; + //return false; + } + return bRes; +} + +void CVSMD12XControl::ILMES_SetPosition(int *piPositionInPulse, size_t szSize) +{ + m_piPositionInPulses = new int[szSize]; + for (size_t i=0;i< szSize;i++) + { + m_piPositionInPulses[i] = piPositionInPulse[i]; + } +} + +bool CVSMD12XControl::ILMES_MoveToPos(int iPositionIndex) +{ + bool bRes = false; + bRes = CVSMD12XControl::StartBackZero(); + if (!bRes) + { + qDebug() << "StartBackZero Err"; + return false; + } + + bRes = CVSMD12XControl::MoveTo(m_piPositionInPulses[iPositionIndex]); + if (!bRes) + { + qDebug() << "MoveTo Err"; + return false; + } + + return bRes; +} + +void CVSMD12XControl::SetProtocolType(int iProtocolType /*= 0*/) +{ + m_iProtocolType = iProtocolType; +} + +void CVSMD12XControl::SetCID(int iID) +{ + m_iCID = iID; + + char cmd[64]; + sprintf_s(cmd, 64, "%d ", iID); + std::string strCID(cmd); + m_strCID = strCID; + return; +} + +void CVSMD12XControl::SetSyncMode(bool bSyncMove /*= false*/) +{ + m_bIsSyncMove = bSyncMove; +} + +bool CVSMD12XControl::InitAndOpenPort(PortInfo portinfo) +{ + bool bRes = false; + if (portinfo.iPortType==0) + { + m_pAbsPort = new CZZ_SeiralPort_QT; + } + + m_pAbsPort->InitPort(portinfo); + + bRes = m_pAbsPort->SetPort(); + if (!bRes) + { + return bRes; + } + bRes = m_pAbsPort->Open(); + return bRes; +} + +std::string CVSMD12XControl::ReadReceive() +{ + return m_pAbsPort->ReadAll(); +} + +int CVSMD12XControl::SendCommand(const std::string strSend) +{ + return m_pAbsPort->Write(strSend); +} + +bool CVSMD12XControl::InitController() +{ +// std::string strTest = "this is a test message."; +// +// char *pcTest = new char[strTest.length()]; +// strTest.copy(pcTest, strTest.length(),0); +// +// memcpy(pcTest, strTest.c_str(), 23); +// +// char *pcTest1 = (char*)strTest.c_str(); +// std::string test=m_pAbsPort->ReadAll(); + std::string strCMD = "dev\n"; + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + int iRet=m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + std::string strRecv = m_pAbsPort->ReadAll(); + ParseReturnedString(strRecv, 0); + std::string::size_type szPosition; + szPosition = strRecv.find("VSMD", 0); + if (szPosition != strRecv.npos) + { + return true; + } + return false; +} + +bool CVSMD12XControl::GetStatus(MSInfo &stuMotorParam) +{ + std::string strCMD = "cts\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + + //QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + ParseReturnedParam(strRecv); + + stuMotorParam = m_stuMSInfo; + return true; +} + +bool CVSMD12XControl::Move(int iRelPulse) +{ + using namespace ZZ_MISCDEF; + char cmd[64]; + sprintf_s(cmd, 64, "rmv %d\n", iRelPulse); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + QThread::msleep(200); + m_pAbsPort->ReadAll(); + if (m_bIsSyncMove) + { + if (iRet != 0) + { + return false; + } + + bool bFlagIsStopped=false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag==0x10 && m_stuMSInfo.fVelocity==0) + { + bFlagIsStopped = true; + } + } + return true; + } + else + { + if (iRet == 0) + { + return true; + } + return false; + } + +} + +bool CVSMD12XControl::Enable() +{ + std::string strCMD = "ena\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::Disable() +{ + std::string strCMD = "off\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); + +} + +bool CVSMD12XControl::MoveTo(int iAbsPulse) +{ + if (iAbsPulse > MAXDISTANCE) + { + //return false; + iAbsPulse = MAXDISTANCE; + } + + char cmd[64]; + sprintf_s(cmd, 64, "pos %d\n", iAbsPulse); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + + int iRet = m_pAbsPort->Write(strCMD); + if (waitetime!=0) + { + QThread::msleep(200); + } + + + m_pAbsPort->ReadAll(); + + if (m_bIsSyncMove) + { + if (iRet != 0) + { + return false; + } + + bool bFlagIsStopped = false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag == 0x10 && m_stuMSInfo.fVelocity == 0) + { + bFlagIsStopped = true; + } + } + return true; + } + else + { + if (iRet == 0) + { + return true; + } + return false; + } +// if (iRet == 0) +// { +// return true; +// } +// return false; +// std::string strTest; +// strTest.resize(7); +// char test[7]; +// //memcpy(test, strCMD.c_str(), 7); +// for (size_t i = 0; i < 7; i++) +// { +// strTest[i] = cmd[i]; +// } +} + +bool CVSMD12XControl::Move_NoSyn(int iRelPulse) +{ + bool a; + waitetime = 0; + m_bIsSyncMove = false; + a = Move(iRelPulse); + m_bIsSyncMove = true; + waitetime = 200; + return a; + +} + +bool CVSMD12XControl::MoveTo_NoSyn(int iAbsPulse) +{ + bool a; + waitetime = 0; + m_bIsSyncMove = false; + a = MoveTo(iAbsPulse); + m_bIsSyncMove = true; + waitetime =200; + return a; +} + +bool CVSMD12XControl::SetLogicZero() +{ + std::string strCMD = "org\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::StartBackZero() +{ + std::string strCMD = "zero start\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + + if (!ParseReturnedString(strRecv, -1)) + { + return false; + } + + bool bFlagIsStopped = false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag == 0x10 && m_stuMSInfo.fVelocity == 0) + { + bFlagIsStopped = true; + } + } + return true; +// return ParseReturnedString(strRecv, -1); + +} + +bool CVSMD12XControl::StopBackZero() +{ + std::string strCMD = "zero stop\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetBaudRate(int iBaudRate) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg bdr=%d\n", iBaudRate); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +int CVSMD12XControl::GetBaudRate() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes= ParseReturnedParam(strRecv); + if (bRes=false) + { + return -1; + } + else + { + return m_stuControllerParams.bdr; + } +} + +bool CVSMD12XControl::SetMicroSteps(int iMicroSteps) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg mcs=%d\n", iMicroSteps); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +int CVSMD12XControl::GetMicroSteps() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.mcs; + } +} + +bool CVSMD12XControl::SetAccSpeed(float fAccSpd) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg acc=%f\n", fAccSpd); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetAccSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.acc; + } +} + +bool CVSMD12XControl::SetRunSpeed(float fRunSpeed) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg spd=%f\n", fRunSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetRunSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.spd; + } +} + +bool CVSMD12XControl::SetDecSpeed(float fDecSpeed) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg dec=%f\n", fDecSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetDecSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.dec; + } +} + +bool CVSMD12XControl::SetSpeed(float fRunSpeed, float fAccSpd, float fDecSpeed) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg spd=%f acc=%f dec=%f\n", fRunSpeed, fAccSpd, fDecSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetHoldCurrent(float fHoldCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg crh=%f\n", fHoldCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetHoldCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.crh; + } +} + +bool CVSMD12XControl::SetAccCurrent(float fAccCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg cra=%f\n", fAccCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetAccCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.cra; + } +} + +bool CVSMD12XControl::SetRunCurrent(float fRunCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg crn=%f\n", fRunCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetRunCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.crn; + } +} + +bool CVSMD12XControl::SetCurrent(float fAccCurrent, float fRunCurrent, float fHoldCurrent) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg cra=%f crn=%f crh=%f\n", fAccCurrent, fRunCurrent, fHoldCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetS1FETE(ZZ_U8 bS1FETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s1f=%d\n", bS1FETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS1FETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s1f; + } +} + +bool CVSMD12XControl::SetS1RETE(ZZ_U8 bS1RETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s1r=%d\n", bS1RETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS1RETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s1r; + } +} + +bool CVSMD12XControl::SetS2FETE(ZZ_U8 bS2FETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s2f=%d\n", bS2FETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS2FETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s2f; + } +} + +bool CVSMD12XControl::SetS2RETE(ZZ_U8 bS2RETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s2r=%d\n", bS2RETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS2RETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s2r; + } +} + +bool CVSMD12XControl::SetZeroParams(ZZ_U8 bZeroMode, ZZ_U8 bSwitchOpenVL, ZZ_U8 bZeroSensor, float fZeroVelocity, int iSafePosition) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg zmd=%d osv=%d snr=%d zsd=%f zsp=%d\n", + (int)bZeroMode, (int)bSwitchOpenVL, (int)bZeroSensor, fZeroVelocity, iSafePosition); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(800); + + std::string strRecv = m_pAbsPort->ReadAll(); + + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetZeroMode() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zmd; + } +} + +ZZ_U8 CVSMD12XControl::GetSwitchOpenVoltageLevel() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.osv; + } +} + +ZZ_U8 CVSMD12XControl::GetZeroSensor() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.snr; + } +} + +int CVSMD12XControl::GetSafePosition() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zsp; + } +} + +float CVSMD12XControl::GetZeroVelocity() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zsp; + } +} + +bool CVSMD12XControl::ParseReturnedString(std::string &strRecv, int iType) +{ + char cHead =(char) 0xFF; + if (iType == -1) + { + if (strRecv[0]== cHead) + { + return true; + } + return false; + } + else if (iType == 0) + { + if (strRecv.size()<3) + { + return false; + } + strRecv.erase(0, 3); + strRecv.erase(strRecv.size() - 3, 3); + return true; + } + else + { + return false; + } +} + +bool CVSMD12XControl::ParseReturnedParam(std::string &strRecv) +{ + + + + while (uchar( strRecv[0])!=0xff&&strRecv.size()>0) + { + //std::cout << strRecv.size() << endl; + strRecv.erase(strRecv.begin()); + //std::cout << strRecv.size() << endl; + + } + int ii = 0; + while (strRecv.size() < 2) + { + + std::string strRecv1 = m_pAbsPort->ReadAll(20); + if (strRecv1.size() == 0) + { + return false; + + } + strRecv = strRecv + strRecv1; + ii++; + if (ii == 2) + { + return false; + + } + } + if (strRecv[2]==0x2) + { + //strRecv.erase(0, 3); + //strRecv.erase(strRecv.size() - 3, 3); + int i = 0; + int izero = 0; + while (strRecv.size() != 21) + { + std::string strRecv1 = ""; + strRecv1 = m_pAbsPort->ReadAll(20); + if (strRecv1.size()==0) + { + return false; + + } + strRecv = strRecv + strRecv1; + i++; + if (i==5) + { + return false; + + } + if (strRecv.size() > 21) + { + return false; + } + //return false; + } + ZZ_U8 *pbRecv = (ZZ_U8*)strRecv.c_str(); + + VSMD_BitShift(&pbRecv[3], &m_unValue); + m_stuMSInfo.fVelocity = m_unValue.fValue; + VSMD_BitShift(&pbRecv[8], &m_unValue); + m_stuMSInfo.iPosition = m_unValue.i32Value; + VSMD_BitShift(&pbRecv[13], &m_unValue); + m_stuMSInfo.uiFlags = m_unValue.u32Value; + + //delete pbRecv; + return true; + } + else if (strRecv[2] == 0x3) + { + strRecv[strRecv.size() - 3] = 0; + char* pcParam = ((char*)strRecv.c_str())+3; + + while (pcParam) + { + char* pcNext = VSMD_Split(pcParam, ' '); + char* pcValueStr = VSMD_Split(pcParam, '='); + + // + if (pcValueStr) + { + if (strcmp(pcParam, "bdr") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.bdr = iValue; + } + else if (strcmp(pcParam, "mcs") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.mcs = iValue; + } + else if (strcmp(pcParam, "spd") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.spd = fValue; + } + else if (strcmp(pcParam, "acc") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.acc = fValue; + } + else if (strcmp(pcParam, "dec") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.dec = fValue; + } + else if (strcmp(pcParam, "cra") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.cra = fValue; + } + else if (strcmp(pcParam, "crn") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.crn = fValue; + } + else if (strcmp(pcParam, "crh") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.crh = fValue; + } + else if (strcmp(pcParam, "s1f") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s1f = iValue; + } + else if (strcmp(pcParam, "s1r") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s1r = iValue; + } + else if (strcmp(pcParam, "s2f") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s2f = iValue; + } + else if (strcmp(pcParam, "s2r") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s2r = iValue; + } + else if (strcmp(pcParam, "zmd") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.zmd = iValue; + } + else if (strcmp(pcParam, "osv") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.osv = iValue; + } + else if (strcmp(pcParam, "snr") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.snr = iValue; + } + else if (strcmp(pcParam, "zsd") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.zsd = fValue; + } + else if (strcmp(pcParam, "zsp") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.zsp = iValue; + } + + } + pcParam = pcNext; + } + return true; + } + + return false; +} + +void CVSMD12XControl::VSMD_BitShift(ZZ_U8* src, unValue* dst) +{ + if (src) + { + dst->u32Value = src[0]; + + dst->u32Value <<= 7; + dst->u32Value |= src[1]; + + dst->u32Value <<= 7; + dst->u32Value |= src[2]; + + dst->u32Value <<= 7; + dst->u32Value |= src[3]; + + dst->u32Value <<= 7; + dst->u32Value |= src[4]; + } +} + +char* CVSMD12XControl::VSMD_Split(char* cStr, char cSplit) +{ + if (cStr) + { + for (char* cPtr = cStr; *cPtr; cPtr++) + { + if (*cPtr == cSplit) + { + *cPtr = '\0'; + cPtr++; + return cPtr; + } + } + } + + return NULL; +} + +// int CVSMD12XControl::add(int a, int b) +// { +// return a + b; +// } diff --git a/othersoft/movingliner/source/LinearShutter/VSMD12XControl.h b/othersoft/movingliner/source/LinearShutter/VSMD12XControl.h new file mode 100644 index 0000000..46e6a5f --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/VSMD12XControl.h @@ -0,0 +1,146 @@ +#pragma once +#include "pch.h" +#include "AbstractPort.h" +using namespace std; +// #ifdef IRIS_API_EXPORTS +// +// #ifdef __cplusplus +// #define IRIS_API_FUNC extern "C" __declspec(dllexport) +// #else +// #define IRIS_API_FUNC __declspec(dllexport) +// #endif +// +// #else +// +// #ifdef __cplusplus +// #define IRIS_API_FUNC extern "C" __declspec(dllimport) +// #else +// #define IRIS_API_FUNC __declspec(dllimport) +// #endif +// +// #endif +// +// +// #ifdef IRIS_API_EXPORTS +// #define IRIS_API_CLASS __declspec(dllexport) +// #else +// #define IRIS_API_CLASS __declspec(dllimport) +// #endif +#define MAXDISTANCE 1265000 +class /*IRIS_API_CLASS*/ CVSMD12XControl +{ +public: + CVSMD12XControl(); + ~CVSMD12XControl(); +private: + int *m_piPositionInPulses; + + CAbstractPort *m_pAbsPort; + unValue m_unValue; + MSInfo m_stuMSInfo; + ControllerParams m_stuControllerParams; + int m_iProtocolType; + int m_iCID; + std::string m_strCID; +public: + bool m_bIsSyncMove; + ////////////////////////////////////////////////////////////////////////// + //for IRIS Linear Motor - Electric Shutter + //Initialize communication setup iPortType(0:RS232 1:RS485) iCID(For RS485 device) bSyncMove(move mode) + bool ILMES_InitializeComm(QString portName,int bandrate=9600, int iPortType = 1, int iCID = 1, bool bSyncMove = true); + //Initialize communication setup iPortType(0:RS232 1:RS485) iCID(For RS485 device) bSyncMove(move mode) + bool ILMES_InitializeComm(PortInfo portinfo,int iPortType = 1,int iCID = 1, bool bSyncMove = true); + + //Initialize Controller params + bool ILMES_InitializeParams(ControllerParams cpParams); + + //Set the light hole position(pulses) + void ILMES_SetPosition(int *piPositionInPulse,size_t szSize); + + bool ILMES_MoveToPos(int iPositionIndex); + +public: + int waitetime; + ////init port + void SetProtocolType(int iProtocolType = 0);//0:RS232 1:RS485 call before send any command + void SetCID(int iID);//set device id when using RS485 protocol call before send any command + void SetSyncMode(bool bSyncMove = false); + bool InitAndOpenPort(PortInfo portinfo);//Init comport by PortInfo Struct + + //////////////////////////////////////////////////////////////////////////for debug or unsupported function + std::string ReadReceive(); + int SendCommand(const std::string strSend); // return indicates how many char has been sent + //////////////////////////////////////////////////////////////////////////motor control + ////init&misc + bool InitController(); //Init Motor controller hand shake + + bool Enable(); //enbale + bool Disable(); //disable + + bool GetStatus(MSInfo &stuMotorParam); //load motor status see MSInfo Struct + ////motion control + bool Move(int iRelPulse); // relative move mode,pulse (-21474836472147483647) + bool MoveTo(int iAbsPulse);//absolute mode,pulse (-21474836472147483647) + bool Move_NoSyn(int iRelPulse); // relative move mode,pulse (-21474836472147483647) + bool MoveTo_NoSyn(int iAbsPulse);//absolute mode,pulse (-21474836472147483647) + bool SetLogicZero(); //set logic zero + + bool StartBackZero();//back zero + bool StopBackZero();// stop back zero & reset register + ////Set&Get + bool SetBaudRate(int iBaudRate);//set controller baud rates,default B9600 (2400 921600) + int GetBaudRate(); // -1:should retry; + + bool SetMicroSteps(int iMicroSteps);//set micro steps (05)->(1/2/4/8/16/32) + int GetMicroSteps(); + + bool SetAccSpeed(float fAccSpd);//set acceleration speed in pulse (0 192000000) + float GetAccSpeed(); + + bool SetRunSpeed(float fRunSpeed);//set normal running speed in pulse (0 192000000) + float GetRunSpeed(); + + bool SetDecSpeed(float fDecSpeed);//set deceleration speed in pulse (0 192000000) + float GetDecSpeed(); + + bool SetSpeed(float fRunSpeed, float fAccSpd, float fDecSpeed);//see above three functions + + bool SetHoldCurrent(float fHoldCurrent);//set hold current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetHoldCurrent(); + + bool SetAccCurrent(float fAccCurrent);//set acceleration current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetAccCurrent(); + + bool SetRunCurrent(float fRunCurrent);//set normal running current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetRunCurrent(); + + bool SetCurrent(float fAccCurrent, float fRunCurrent, float fHoldCurrent);//see above three functions + + bool SetS1FETE(ZZ_U8 bS1FETE);//S1 register falling edge trigger event,see enum + ZZ_U8 GetS1FETE(); + + bool SetS1RETE(ZZ_U8 bS1RETE);//S1 register rising edge trigger event + ZZ_U8 GetS1RETE(); + + bool SetS2FETE(ZZ_U8 bS2FETE);//S2 register falling edge trigger event + ZZ_U8 GetS2FETE(); + + bool SetS2RETE(ZZ_U8 bS2RETE);//S2 register rising edge trigger event + ZZ_U8 GetS2RETE(); + + //(ZeroMode 0:off 1:once 2:once + safe position 3:twice 4:twice + safe position) (OpenVoltageLevel 0:Low Level 1:High Level) + //(ZeroSensor 0:S1 1:S2 2:S3 3:S4 4:S5 5:S6)( ZeroVelocity -192000) 192000pulse)(SafePosition -2147483647) 2147483647) + bool SetZeroParams(ZZ_U8 bZeroMode, ZZ_U8 bSwitchOpenVL, ZZ_U8 bZeroSensor, float fZeroVelocity, int iSafePosition); + ZZ_U8 GetZeroMode(); + ZZ_U8 GetSwitchOpenVoltageLevel(); + ZZ_U8 GetZeroSensor(); + int GetSafePosition(); + float GetZeroVelocity(); + +private: + bool ParseReturnedString(std::string &strRecv,int iType); + bool ParseReturnedParam(std::string &strRecv); + void VSMD_BitShift(ZZ_U8* src, unValue* dst); + char* VSMD_Split(char* cStr, char cSplit); +}; + diff --git a/othersoft/movingliner/source/LinearShutter/VSMD12XMiscDefines.h b/othersoft/movingliner/source/LinearShutter/VSMD12XMiscDefines.h new file mode 100644 index 0000000..6de39a7 --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/VSMD12XMiscDefines.h @@ -0,0 +1,108 @@ +#pragma once +#include "ZZ_Types.h" +#define MAXBUFFER 10240 +#include +using namespace ZZ_MISCDEF; + +typedef struct tagTransportLayerInfomation +{ + //Serial + int iPortType; + int iPortNumber; + int indexBaudRate; + int iBaudRate; + int indexParity, indexBytesize, indexStopBits; //Mode + bool Hw; + bool Sw; + bool Dtr, Rts; + QString FullPortName; + tagTransportLayerInfomation() { + iPortType = 0; + indexParity = 0; + iPortNumber = 8; + iBaudRate = 9600; + indexBytesize = 3; + indexStopBits = 0; + FullPortName = ""; + } + + //Bit + //Stop + //MODEM CONTROL setting + //MODEM LINE STATUS + + //TCP UDP + +}PortInfo; + +typedef struct tagMotorStatusInfo +{ + float fVelocity; + int iPosition; + ZZ_U32 uiFlags; +}MSInfo; + +typedef struct tagControllerParams +{ + int bdr; //baud + int mcs; //microsteps 0:full 1:half 2:4 3:8 4:16 5:32 6:64 7:128 8:256 + float spd; //velocity + float acc; //acceleration + float dec; //deceleration + float cra; //acc state current + float crn; //normal state current + float crh; //hold state current + ZZ_U8 s1f; + ZZ_U8 s1r; + ZZ_U8 s2f; + ZZ_U8 s2r; + ZZ_U8 zmd; //zero mode + ZZ_U8 osv; //open state sensor value + ZZ_U8 snr; //zero sensor + ZZ_U8 zsp; //zero safe position + float zsd; //zero velocity + tagControllerParams() { + bdr = 9600; + + cra = 0.8; + crh = 0.1; + crn = 0.8; + + acc = 100000; + dec = 100000; + spd = 64000; + + osv = 0; + snr = 0; + zmd = 3; + zsp = 20; + zsd = 50000; + + mcs = 6; + } +}ControllerParams; + +typedef union +{ + ZZ_U8 byteValue[4]; + short i16Value[2]; + ZZ_U16 u16Value[2]; + int i32Value; + float fValue; + ZZ_U32 u32Value; +}unValue; + +enum emVSMDTriggerEvent +{ + NoAction =0, //�޶�����ֻ��״̬λ S1 �仯֪ͨ�� + ResetZeroPosition, //��������ԭ��λ�� + DecSpdStop, //����ֹͣ + DecSpdStopRZP, //����ֹͣ������ֹͣ����������ԭ��λ�� + Stop, //����ֹͣ + StopRZP, //����ֹͣ������ֹͣ����������ԭ��λ�� + RunningPosDirect, //����������ת�����ٶȣ� + RunningNegDirect, //����������ת�����ٶȣ� + OfflineModeOn, //����ģʽ���� + OfflineModeOff //����ģʽֹͣ +}; + diff --git a/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.cpp b/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.cpp new file mode 100644 index 0000000..d5767ad --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.cpp @@ -0,0 +1,147 @@ +#include "pch.h" +#include "ZZ_SeiralPort.h" + +CZZ_SeiralPort_QT::CZZ_SeiralPort_QT() +{ + m_pSerialPort = new QSerialPort(); +} + +CZZ_SeiralPort_QT::~CZZ_SeiralPort_QT() +{ + if (m_pSerialPort != NULL) + { + delete m_pSerialPort; + } +} + + void CZZ_SeiralPort_QT::InitPort(PortInfo portinfo) +{ + + m_piSettings = portinfo; + + +} + + bool CZZ_SeiralPort_QT::SetPort() + { + bool bRes = true; +// int iRes = sio_ioctl(m_piSettings.iPortNumber, m_piSettings.indexBaudRate, +// m_piSettings.indexParity | m_piSettings.indexBytesize | m_piSettings.indexStopBits); +// if (iRes != SIO_OK) +// { +// bRes = false; +// } + QString qstrPortName; + if (m_piSettings.FullPortName!="") + { + qstrPortName = m_piSettings.FullPortName; + qDebug() << m_piSettings.FullPortName; + } + else { + qstrPortName = QString("COM%1").arg(m_piSettings.iPortNumber); + } + // qstrPortName = "COM4"; + // QString qstrPortName = m_piSettings.FullPortName;//QString("COM%1").arg(m_piSettings.iPortNumber); + m_pSerialPort->setPortName(qstrPortName); + m_pSerialPort->setReadBufferSize(512); + bRes = m_pSerialPort->setBaudRate(m_piSettings.iBaudRate); + return bRes; + } + +bool CZZ_SeiralPort_QT::Open() +{ + bool bRes = true; +// int iRes = sio_open(m_piSettings.iPortNumber); +// if (iRes!=SIO_OK) +// { +// bRes = false; +// } + bRes = m_pSerialPort->open(QIODevice::ReadWrite); + if (!bRes) + { + qDebug() << "Err:open Failed.Exit Code:1"; + //std::cout << "Err.open Failed" << std::endl; + return bRes;; + } + return bRes; +} + +void CZZ_SeiralPort_QT::Close() +{ + m_pSerialPort->close(); +} + +std::string CZZ_SeiralPort_QT::ReadAll(int waite) +{ + if (!m_pSerialPort->waitForReadyRead(waite)) + { + return ""; + + } + if ( + m_pSerialPort->bytesAvailable() == 0 + ) + { + return ""; + } + + qbaRecv.clear(); + + qbaRecv = m_pSerialPort->readAll(); + + + std::string strRet(qbaRecv.constData(), qbaRecv.length()); + return strRet; + +// std::string strRet; +// char cBuf[MAXBUFFER]; +// int iRet = sio_read(m_piSettings.iPortNumber,cBuf, MAXBUFFER); +// if (iRet==0) +// { +// strRet = ""; +// +// } +// else +// { +// char *pRecv = new char[iRet]; +// memcpy(pRecv, cBuf, iRet); +// //std::string strRet(pRecv); +// //delete pRecv; +// //return strRet; +// +// strRet.resize(iRet); +// for (int i=0;iwrite(qbaTest); + m_pSerialPort->waitForBytesWritten(5000); + if (qi64Write != qbaTest.size()) + { + qDebug() << "Err:write Failed.Exit Code:1" << qi64Write; + return qi64Write; + } + + return 0; +// char* pcSend = (char*)strSend.c_str(); +// int iRet = sio_write(m_piSettings.iPortNumber, pcSend, (int)strSend.length()); +// +// //delete pcSend; +// if (iRet!= (int)strSend.length()) +// { +// return iRet; +// } +// else +// { +// return 0; +// } +// //sio_write(); +} diff --git a/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.h b/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.h new file mode 100644 index 0000000..5d7d0f4 --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/ZZ_SeiralPort.h @@ -0,0 +1,26 @@ +#pragma once +#include "VSMD12XMiscDefines.h" +#include "AbstractPort.h" +#include"qobject.h" +class CZZ_SeiralPort_QT :public CAbstractPort,QObject +{ + +private: + PortInfo m_piSettings; + QByteArray qbaSend, qbaRecv; + QSerialPort *m_pSerialPort; +public: + CZZ_SeiralPort_QT(); + virtual ~CZZ_SeiralPort_QT(); +public: + virtual void InitPort(PortInfo portinfo); + virtual bool SetPort(); + virtual bool Open(); + virtual void Close(); + + virtual std::string ReadAll(int waittime = 5000); + + virtual int Write(const std::string strSend); + +}; + diff --git a/othersoft/movingliner/source/LinearShutter/ZZ_Types.h b/othersoft/movingliner/source/LinearShutter/ZZ_Types.h new file mode 100644 index 0000000..7ad1c54 --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/ZZ_Types.h @@ -0,0 +1,297 @@ +////////////////////////////////////////////////////////////////////////// +//˵ļ +////////////////////////////////////////////////////////////////////////// +#pragma once +#include "pch.h" +#include +#define MAX_DEVICENUMBER_FS 2 +#define MAX_LINEARSHUTTER_POSITION 12 +namespace ZZ_MISCDEF +{ + typedef unsigned char ZZ_U8; + typedef unsigned short int ZZ_U16; + typedef unsigned long int ZZ_U32; + + + namespace IRIS + { + //Fiber Spectrometer + namespace FS + { + typedef struct tagDataFrame + { + ZZ_U16 usExposureTimeInMS; + ZZ_U16 usData[4096]; + float fTemperature; + double dTimes = 0; + }DataFrame; + + typedef struct tagDeviceInfo + { + std::string strPN; + std::string strSN; + }DeviceInfo; + + typedef struct tagDeviceAttribute + { + int iPixels; + int iMaxIntegrationTimeInMS; + int iMinIntegrationTimeInMS; + float fWaveLengthInNM[4096]; + + }DeviceAttribute; + } + + enum DeviceModel + { + OSIFAlpha=0, + OSIFBeta, + ISIF, + IS1, + IS2 + }; + +// inline std::string GetDeviceModelName(int iModel) +// { +// switch (iModel) +// { +// case DeviceModel::OSIFAlpha: return "OSIFAlpha"; break; +// case DeviceModel::OSIFBeta: return "OSIFBeta"; break; +// case DeviceModel::ISIF: return "ISIF"; break; +// case DeviceModel::IS1: return "IS1"; break; +// case DeviceModel::IS2: return "IS2"; break; +// default: return "error"; break; +// } +// } +// +// inline int GetIndex(std::string strDeviceModelName) +// { +// if (strDeviceModelName== "OSIFAlpha") +// { +// return DeviceModel::OSIFAlpha; +// } +// else if (strDeviceModelName == "OSIFBeta") +// { +// return DeviceModel::OSIFBeta; +// } +// else if (strDeviceModelName == "ISIF") +// { +// return DeviceModel::ISIF; +// } +// else if (strDeviceModelName == "IS1") +// { +// return DeviceModel::IS1; +// } +// else if(strDeviceModelName == "IS2") +// { +// return DeviceModel::IS2; +// } +// else +// { +// return -1; +// } +// } + + }; + + //ATPָת + namespace ATP + { + const int MAX_SPECTRUM_SIZE = 4096; + + const int GET_MODULECIRCUIT_TEMP = 0x01; + const int GET_PN_NUMBER = 0x03; + const int GET_SN_NUMBER = 0x04; + const int GET_MANUFACTURE_DATA = 0x06; + const int GET_MANUFACTURE_INFO = 0x09; + const int GET_PIXEL_LENGTH = 0x0a; + const int GET_TEC_TEMP = 0x13; + const int SET_TEC_TEMP = 0x12; + const int GET_OPTICS_TEMP = 0x35; + const int GET_CIRCUITBOARD_TEMP = 0x36; + const int SET_INTEGRATION_TIME = 0x14; + const int GET_INTEGRATION_TIME = 0x41; + const int GET_MAX_INTEGRATION_TIME = 0x42; + const int GET_MIN_INTEGRATION_TIME = 0x43; + const int ASYNC_COLLECT_DARK = 0x23; + const int ASYNC_START_COLLECTION = 0x16; + const int ASYNC_READ_DATA = 0x17; + const int SET_AVERAGE_NUMBER = 0x28; + const int SYNC_GET_DATA = 0x1e; + const int SYNC_GET_DARK = 0x2f; + const int EXTERNAL_TRIGGER_ENABLE = 0x1f; + const int SET_XENON_LAMP_DELAY_TIME = 0x24; + const int GET_WAVELENGTH_CALIBRATION_COEF = 0x55; + const int GET_STAT_LAMPOUT = 0x60; + const int SET_GPIO = 0x61; + //const int SYNCHRONIZATION_GET_DARK = 0x23 + + //////////////////////////////////////////////////////////////////////////device + enum Model + { + ATP1010 = 0, + ATP6500 + }; + + //֡ + typedef struct tagATPDataFrame + { + unsigned short usExposureTime; + ZZ_U16 usData[4096]; + float fTemperature; + double dTimes = 0; + }ATPDataFrame; + + //豸Ϣ + typedef struct tagATPDeviceInfo + { + std::string strPN; + std::string strSN; + }ATPDeviceInfo; + + //豸 + typedef struct tagATPDeviceAttribute + { + int iPixels; + int iMaxIntegrationTime; + int iMinIntegrationTime; + float fWaveLength[4096]; + + }ATPDeviceAttribute; + //////////////////////////////////////////////////////////////////////////config file + + + + } + + //в + namespace ZZ_RUNPARAMS + { + typedef struct tagFiberSpecContext + { + ZZ_U8 ucDeviceNumber; + ZZ_U8 ucDeviceModel[MAX_DEVICENUMBER_FS]; + int iInterface[MAX_DEVICENUMBER_FS]; + std::string strSN[MAX_DEVICENUMBER_FS]; + }FSContext; + + typedef struct tagLinearShutterContext + { + ZZ_U8 ucPort; + ZZ_U8 ucProtocolType; + ZZ_U8 ucCmdID; + }LSContext; + + typedef struct tagAcquisitionTimeSettings + { + QTime qtStartTime; + QTime qtStopTime; + QTime qtInterval; + }AcqTimeSettings; + + typedef struct tagAcquisitionPositionSettings + { + int iTotalPosition; + int iPosition[MAX_LINEARSHUTTER_POSITION]; + }AcqPosSettings; + + typedef struct tagRunTimeGrabberParams + { + LSContext lscParam; + FSContext fscParams; + AcqTimeSettings atsParams; + AcqPosSettings apsParams; + }RunTimeGrabberParams; + + typedef struct tagATPCalibrationSettings + { + //Up0 Down1,2,3 + QString qsISIF_CalibrationFilePath[4]; + QString qsIS1_CalibrationFilePath[4]; + }ATPCalibrationSettings; + } + + //ϵͳļṹ + namespace ZZ_DATAFILE + { + typedef struct tagEnvironmentalContext + { + QString qstrUTCDateTime; + QString qstrLocation; + QString qstrGPS_Longtitude; + QString qstrGPS_Latitude; + QString qstrGPS_Altitude; + QString qstrGPS_North; + QString qstrCaseTemperature; + QString qstrCaseHumidity; + + }EContext; + + typedef struct tagManmadeEnviromentalContext + { + QString qstrOriFileName; + QString qstrInstallationTime; + QString qstrISIFCalibrationTime; + QString qstrIS1CalibrationTime; + QString qstrNameOfMaintenanceStaff; + QString qstrPhoneNumberOfMaintenanceStaff; + QString qstrDownloadUserID; + QString qstrDownlaodAddress; + QString qstrHTTPServer; + }MEContext; + + + typedef struct tagIS1Information + { + QString qstrSN_ATP; + QString qstrSN_IRIS; + + QString qstrCalFile_U0; + QString qstrCalFile_D1; + QString qstrCalFile_D2; + QString qstrCalFile_D3; + + int iPixelCount; + + int iExposureTimeInMS_U0; + int iExposureTimeInMS_D1; + int iExposureTimeInMS_D2; + int iExposureTimeInMS_D3; + + float fTemperature_U0; + float fTemperature_D1; + float fTemperature_D2; + float fTemperature_D3; + }IS1Info; + + typedef struct tagISIFInformation + { + QString qstrSN_ATP; + QString qstrSN_IRIS; + + QString qstrCalFile_U0; + QString qstrCalFile_D1; + QString qstrCalFile_D2; + QString qstrCalFile_D3; + + int iPixelCount; + + int iExposureTimeInMS_U0; + int iExposureTimeInMS_D1; + int iExposureTimeInMS_D2; + int iExposureTimeInMS_D3; + + float fTemperature_U0; + float fTemperature_D1; + float fTemperature_D2; + float fTemperature_D3; + }ISIFInfo; + + typedef struct tagATPDataHeader + { + + + }ATPDataHeader; + } + +}; diff --git a/othersoft/movingliner/source/LinearShutter/pch.h b/othersoft/movingliner/source/LinearShutter/pch.h new file mode 100644 index 0000000..d5ac3af --- /dev/null +++ b/othersoft/movingliner/source/LinearShutter/pch.h @@ -0,0 +1,28 @@ +#pragma once +#include +////////////////////////////setings +#include +#include +////////////////////////////Basic +#include +#include +#include +#include +#include +////////////////////////////Thread +#include +#include +#include +////////////////////////////json +#include +#include +#include +#include +#include +////////////////////////////time +#include +#include +#include +////////////////////////////Serial I/O +#include +#include \ No newline at end of file diff --git a/othersoft/movingliner/source/Settings/SystemConfigger.cpp b/othersoft/movingliner/source/Settings/SystemConfigger.cpp new file mode 100644 index 0000000..46e8800 --- /dev/null +++ b/othersoft/movingliner/source/Settings/SystemConfigger.cpp @@ -0,0 +1,191 @@ +#include "SystemConfigger.h" + + + ZZ_SysConfigger::ZZ_SysConfigger(QObject *parent /*= nullptr*/) + { +#ifdef _DEBUG + m_qstrDeviceConfigFilePath = "E:/WorkSpace/TowerOptoSifAndSpectral/config/DeviceSettings.ini"; + m_qstrJSONConfigFilePath = "E:/WorkSpace/TowerOptoSifAndSpectral/config/config.json"; +#else + m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json"); +#endif // DEBUG + + m_qsDeviceConfig = NULL; + } + + ZZ_SysConfigger::~ZZ_SysConfigger() + { + if (qfJConfig.isOpen()) + { + qfJConfig.close(); + } + } + + int ZZ_SysConfigger::Initialize() + { + //////////////////////////////////////////////////////////////////////////load device settings + using namespace ZZ_MISCDEF; + QMetaEnum enumDeviceModel = QMetaEnum::fromType(); + + if (m_qsDeviceConfig!=NULL) + { + delete m_qsDeviceConfig; + } + m_qsDeviceConfig = new QSettings(m_qstrDeviceConfigFilePath, QSettings::IniFormat); + m_struDeviceContext.ucDeviceNumber = m_qsDeviceConfig->value(QString("DEVICE INFO/TotalSpectrometer"),-1).toInt(); + if (m_struDeviceContext.ucDeviceNumber == -1) + { + qDebug() << "DEVICE INFO TotalSpectrometer Value Err."; + return 3; + } + for (ZZ_U8 i=0;i< m_struDeviceContext.ucDeviceNumber;i++) + { + QString qstrTemp= m_qsDeviceConfig->value(QString("FS%1/Model").arg(i+1), "Null").toString(); + m_struDeviceContext.ucDeviceModel[i]= enumDeviceModel.keysToValue(qstrTemp.toLatin1().data()); + + int iInterface= m_qsDeviceConfig->value(QString("FS%1/Port").arg(i + 1), -2).toInt(); + m_struDeviceContext.iInterface[i] = iInterface; + + qstrTemp = m_qsDeviceConfig->value(QString("FS%1/UID").arg(i + 1), "Null").toString(); + m_struDeviceContext.strSN[i] = qstrTemp.toStdString(); + } + + m_struAcqPosition.iTotalPosition = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/TotalPosition"), -1).toInt(); + if (m_struAcqPosition.iTotalPosition == -1) + { + qDebug() << "LINEAR SHUTTER TotalPosition Value Err."; + return 4; + } + + for (ZZ_U8 i = 0; i < m_struAcqPosition.iTotalPosition; i++) + { + int iPosition = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Position%1").arg(i), -2).toInt(); + m_struAcqPosition.iPosition[i] = iPosition; + } + + + + //////////////////////////////////////////////////////////////////////////load json settings + qfJConfig.setFileName(m_qstrJSONConfigFilePath); + bool bRes = qfJConfig.open(QIODevice::ReadOnly); + if (!bRes) + { + qDebug() << "QFile open config file Err."; + return 1; + } + + m_qbaJData = qfJConfig.readAll(); + m_qjdJDoc= QJsonDocument::fromJson(m_qbaJData, &m_qjpeJErr); + if (m_qjpeJErr.error != QJsonParseError::NoError) + { + qDebug() << m_qjpeJErr.errorString(); + return 2; + } + m_qjoJObj = m_qjdJDoc.object(); + return 0; + } + + int ZZ_SysConfigger::GetGrabberRunParams(RunTimeGrabberParams &struGrabberRTParams) + { + struGrabberRTParams.atsParams = m_struAcqTime; + struGrabberRTParams.fscParams = m_struDeviceContext; + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_IS1() + { + m_struIS1Info.qstrCalFile_U0 = m_qjoJObj.value("IS1UpCalFile").toString(); + m_struIS1Info.qstrCalFile_D1 = m_qjoJObj.value("IS1DownCalFile1").toString(); + m_struIS1Info.qstrCalFile_D2 = m_qjoJObj.value("IS1DownCalFile2").toString(); + m_struIS1Info.qstrCalFile_D3 = m_qjoJObj.value("IS1DownCalFile3").toString(); + + + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_iSIF() + { + m_struISIFInfo.qstrCalFile_U0 = m_qjoJObj.value("SIFUpCalFile").toString(); + m_struISIFInfo.qstrCalFile_D1 = m_qjoJObj.value("SIFDownCalFile1").toString(); + m_struISIFInfo.qstrCalFile_D2 = m_qjoJObj.value("SIFDownCalFile2").toString(); + m_struISIFInfo.qstrCalFile_D3 = m_qjoJObj.value("SIFDownCalFile3").toString(); + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_System() + { + // QString qstr = m_qjoJObj.value("IntervalTime").toString(); + m_struAcqTime.qtStartTime=QTime::fromString(m_qjoJObj.value("BeginTime").toString(), "hh:mm"); + if (!m_struAcqTime.qtStartTime.isValid()) + { + qDebug() << "Invalid BeginTime"; + return 1; + } + +#ifdef _DEBUG + m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "ss"); + if (!m_struAcqTime.qtInterval.isValid()) + { + qDebug() << "Invalid IntervalTime"; + return 1; + } +#else + m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "mm"); + if (!m_struAcqTime.qtInterval.isValid()) + { + qDebug() << "Invalid IntervalTime"; + return 1; + } +#endif + + m_struAcqTime.qtStopTime = QTime::fromString(m_qjoJObj.value("EndTime").toString(), "hh:mm"); + if (!m_struAcqTime.qtStopTime.isValid()) + { + qDebug() << "Invalid EndTime"; + return 1; + } + + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_MISC() + { + m_struEC.qstrLocation = m_qjoJObj.value("Location").toString(); + m_struEC.qstrGPS_Altitude = m_qjoJObj.value("GPS_Altitude").toString(); + m_struEC.qstrGPS_Latitude = m_qjoJObj.value("GPS_Latitude").toString(); + m_struEC.qstrGPS_Longtitude = m_qjoJObj.value("GPS_Longtitude").toString(); + m_struEC.qstrGPS_North = m_qjoJObj.value("GPS_North").toString(); + + m_struMEC.qstrInstallationTime = m_qjoJObj.value("InstallationTime").toString(); + m_struMEC.qstrISIFCalibrationTime = m_qjoJObj.value("ISIFCalibrationTime").toString(); + m_struMEC.qstrIS1CalibrationTime = m_qjoJObj.value("IS1CalibrationTime").toString(); + m_struMEC.qstrNameOfMaintenanceStaff = m_qjoJObj.value("NameOfMaintenanceStaff").toString(); + m_struMEC.qstrPhoneNumberOfMaintenanceStaff = m_qjoJObj.value("PhoneNumberOfMaintenanceStaff").toString(); + m_struMEC.qstrDownloadUserID = m_qjoJObj.value("DownloadUserID").toString(); + m_struMEC.qstrDownlaodAddress = m_qjoJObj.value("DownlaodAddress").toString(); + + + + return 0; + } + + int ZZ_SysConfigger::LoadSettings_Test() + { + QFile qfTest(m_qstrJSONConfigFilePath); + + qfTest.open(QFile::ReadOnly); + + QByteArray qbJData = qfTest.readAll(); + + QJsonParseError jerr; + QJsonDocument jdoc(QJsonDocument::fromJson(qbJData, &jerr)); + if (jerr.error!= QJsonParseError::NoError) + { + qDebug() << jerr.errorString(); + } + + QJsonObject rootobj = jdoc.object(); + QStringList key = rootobj.keys(); + QString qtest1 = rootobj.value(rootobj.keys().at(15)).toString(); + return 0; + } diff --git a/othersoft/movingliner/source/Settings/SystemConfigger.h b/othersoft/movingliner/source/Settings/SystemConfigger.h new file mode 100644 index 0000000..6f237a2 --- /dev/null +++ b/othersoft/movingliner/source/Settings/SystemConfigger.h @@ -0,0 +1,57 @@ +#pragma once +#include "pch.h" +#include "ZZ_Types.h" +using namespace ZZ_MISCDEF::ZZ_RUNPARAMS; +using namespace ZZ_MISCDEF::ZZ_DATAFILE; + +class ZZ_SysConfigger :public QObject +{ + Q_OBJECT + +public: + ZZ_SysConfigger(QObject *parent = nullptr); + virtual ~ZZ_SysConfigger(); +public: + int Initialize(); + int GetGrabberRunParams(RunTimeGrabberParams &struGrabberRTParams); + + int LoadSettingsFromFile_IS1(); + int LoadSettingsFromFile_iSIF(); + int LoadSettingsFromFile_System(); + int LoadSettingsFromFile_MISC(); + int LoadSettings_Test(); +public: + enum ConfiggerDeviceModel + { + OSIFAlpha = 0, + OSIFBeta, + ISIF, + IS1, + IS2, + Null + }; + Q_ENUM(ConfiggerDeviceModel); + //////////////////////////////////////////////////////////////////////////run-time settings + AcqTimeSettings m_struAcqTime; + FSContext m_struDeviceContext; + AcqPosSettings m_struAcqPosition; + ////////////////////////////////////////////////////////////////////////// + EContext m_struEC; + MEContext m_struMEC; + IS1Info m_struIS1Info; + ISIFInfo m_struISIFInfo; + +private: + QString m_qstrDeviceConfigFilePath; + QString m_qstrJSONConfigFilePath; + QFile qfJConfig/*,qfDeviceConfig*/; + QSettings *m_qsDeviceConfig; + + QByteArray m_qbaJData; + QJsonParseError m_qjpeJErr; + QJsonObject m_qjoJObj; + QJsonDocument m_qjdJDoc; + + + +}; \ No newline at end of file diff --git a/othersoft/shuttercali/project/LocationCali/CMakeLists.txt b/othersoft/shuttercali/project/LocationCali/CMakeLists.txt new file mode 100644 index 0000000..3f78fd7 --- /dev/null +++ b/othersoft/shuttercali/project/LocationCali/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.3) + +project(shutter_calibrate) +set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} C:/Qt/Qt5.12.7/5.12.7/mingw73_64) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) +set(QT Core Gui Network WebSockets SerialPort Widgets) +set(CMAKE_CXX_STANDARD 14) +find_package(Qt5 REQUIRED ${QT}) + + +file(GLOB_RECURSE HDR_LIST "../../source/*.h") +file(GLOB_RECURSE SRC_LIST "../../source/*.cpp") +file(GLOB_RECURSE HDR_LIST1 "../../source_rlx/*.h") +file(GLOB_RECURSE SRC_LIST1 "../../source_rlx/*.cpp") + +include_directories("../../source") +include_directories("../../source/FS") +include_directories("../../source/Logger") +include_directories("../../source/ZZ_SDK") +include_directories("../../source/Settings") +include_directories("../../source/Thread") +include_directories("../../source/LinearShutter") +include_directories("../../source_rlx/ShutterCali") +include_directories("../../source_rlx/sensor") +include_directories("../../source/OSIF/include") +include_directories("D:/02Raspberry/2020-12-17/SeaBreeze/include") +link_directories("D:/02Raspberry/2020-12-17/SeaBreeze/lib") +link_directories("/home/pi/SeaBrease/lib") +add_executable( shutter_calibrate main.cpp + ${HDR_LIST} + ${SRC_LIST} + ${HDR_LIST1} + ${SRC_LIST1} +) +qt5_use_modules(shutter_calibrate ${QT}) +target_link_libraries(shutter_calibrate SeaBreeze) +IF (WIN32) +target_link_libraries(shutter_calibrate SeaBreeze) +ELSE () +target_link_libraries(shutter_calibrate seabreeze usb stdc++ m) +ENDIF () +set_target_properties(shutter_calibrate PROPERTIES AUTOMOC ON) + + diff --git a/othersoft/shuttercali/project/LocationCali/SeaBreeze.dll b/othersoft/shuttercali/project/LocationCali/SeaBreeze.dll new file mode 100644 index 0000000..66bc74c Binary files /dev/null and b/othersoft/shuttercali/project/LocationCali/SeaBreeze.dll differ diff --git a/othersoft/shuttercali/project/LocationCali/SeaBreeze.lib b/othersoft/shuttercali/project/LocationCali/SeaBreeze.lib new file mode 100644 index 0000000..9f5efa5 Binary files /dev/null and b/othersoft/shuttercali/project/LocationCali/SeaBreeze.lib differ diff --git a/othersoft/shuttercali/project/LocationCali/main.cpp b/othersoft/shuttercali/project/LocationCali/main.cpp new file mode 100644 index 0000000..b725eaa --- /dev/null +++ b/othersoft/shuttercali/project/LocationCali/main.cpp @@ -0,0 +1,202 @@ +#include +#include +#include "QTextCodec" +#include "SensorMannager.h" +#include"SensorOptoSky.h" +#include"SensorQExPRO.h" +#include +#include +#include +QTextStream cout1(stdout, QIODevice::WriteOnly); +void logout(QString str){ + std::cout<"; + std::fflush(stdout); +} +vector FindFeng(vector point1ist, vector valuelist); +vector DengJianJu(int position, int distanc, int times = 10); +vector PingHua(vector value, int step = 2); +int main(int argc, char* argv[]) +{ + QCoreApplication aaaaa(argc, argv); + cout1<<"Welcom to use the Auto Locate Application"<<"
"<initSensor(); + + cout1<<"Get Tempratrue:"<GettingTempratrue()<<"
"<Settingshuttertime(20); + aa->GetOnePlot(oneplot); + cout1<<"Position"<< oneplot.Plot[1000]; + + + + + CVSMD12XControl Motercontrol; + Motercontrol.ILMES_InitializeComm("COM16"); + + //Motercontrol.ILMES_InitializeComm("/dev/ttyUSB1"); + ControllerParams cpTest; + bool res = Motercontrol.ILMES_InitializeParams(cpTest); + Motercontrol.StartBackZero(); + Motercontrol.SetRunSpeed(10000); + Motercontrol.MoveTo_NoSyn(550000); + aa->GetOnePlot(oneplot); + MSInfo temp; + Motercontrol.GetStatus(temp); + vector point1ist; + vector valuelist; + int i = 0; + Motercontrol.GetStatus(temp); + //outfile <GetOnePlot(oneplot); + //qDebug() << oneplot.BandNum; + //std::cout << temp.iPosition << std::endl; + + Motercontrol.GetStatus(temp); + i++; + //outfile << i << "," << oneplot.Plot[1024] << "," << temp.iPosition << std::endl; + point1ist.push_back(temp.iPosition); + valuelist.push_back(oneplot.Plot[1024]); + + } + Motercontrol.StartBackZero(); + vector valuepinghua1 = PingHua(valuelist, 3); + vectorloction1=FindFeng(point1ist, valuepinghua1); + int lenth = loction1.size(); + for (size_t i = 0; i < lenth; i++) + { + vector location1point = DengJianJu(loction1[i], 5000, 25); + vector valuepoint; + int lennow = location1point.size(); + for (size_t ii = 0; ii < lennow; ii++) + { + Motercontrol.MoveTo(location1point[ii]); + aa->GetOnePlot(oneplot); + valuepoint.push_back(oneplot.Plot[1024]); + //outfile << ii << "," << oneplot.Plot[1024] << "," << location1point[ii] << std::endl; + } + vector valuepinghua = PingHua(valuepoint,3); + vectorloction2 = FindFeng(location1point, valuepinghua); + if (loction2.size() == 1) + { + outfile < FindFeng(vector point1ist, vector valuelist) +{ + vector ret; + int lenth = point1ist.size(); + if (lenth<10) + { + ret.push_back(0); + return ret; + } + for (size_t i = 5; i < lenth-5; i++) + { + if (valuelist[i] > 5000&&valuelist[i]>valuelist[i-1]&& valuelist[i] > valuelist[i - 4]&& valuelist[i] >valuelist[i + 1]&& valuelist[i] > valuelist[i + 4] + && valuelist[i-1] > 5000 && valuelist[i-4]&& valuelist[i +1] > 5000 && valuelist[i + 4]) + { + if (ret.size()!=0) + { + if (point1ist[i]-ret[ret.size()-1]<5000) + { + continue; + } + + } + ret.push_back(point1ist[i]); + + + } + + } + return ret; + + + +} +vector DengJianJu(int position, int distanc, int times ) +{ + int begin = position - distanc; + vector ret; + int eachstep = distanc / times; + for (size_t i = 0; i < 2*times; i++) + { + ret.push_back(begin + i * eachstep); + } + return ret; + +} +vector PingHua(vector value,int step) +{ + vector ret; + if (value.size()<2*step) + { + return value; + } + int len = value.size(); + for (size_t i = 0; i < step; i++) + { + ret.push_back(value[i]); + } + for (size_t i = step; i setPortName(qstrPortName); + m_pSerialPort->setReadBufferSize(512); + bool bRes = m_pSerialPort->setBaudRate(m_iBaudRate); + if (!bRes) + { + qDebug() << "Err:setBaudRate Failed.Exit Code:1"; + //std::cout << "Err.setBaudRate Failed" << std::endl; + return 1; + } + + bRes = m_pSerialPort->open(QIODevice::ReadWrite); + if (!bRes) + { + qDebug() << "Err:open Failed.Exit Code:2"; + //std::cout << "Err.open Failed" << std::endl; + return 2; + } + + return 0; +} + +void ZZ_ATPControl_Serial_Qt::Close() +{ + m_pSerialPort->close(); +} +int ZZ_ATPControl_Serial_Qt::GetDeviceInfo(DeviceInfo &Info) +{ + QByteArray qbSend, qbRecv; + + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_PN_NUMBER); + int iRes = SendCommand(qbSend); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = RecvData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = ParseData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + m_diDeviceInfo.strPN = qbRecv.data(); + + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_SN_NUMBER); + iRes = SendCommand(qbSend); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = RecvData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = ParseData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceInfo Failed,Communication error.Exit Code:1"; + return 1; + } + m_diDeviceInfo.strSN = qbRecv.data(); + + + Info = m_diDeviceInfo; + return 0; +} + +int ZZ_ATPControl_Serial_Qt::GetDeviceAttribute(DeviceAttribute &Attr) +{ + QByteArray qbSend, qbRecv; + + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_MIN_INTEGRATION_TIME); + int iRes = SendCommand(qbSend); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = RecvData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = ParseData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + m_daDeviceAttr.iMinIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256; + + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_MAX_INTEGRATION_TIME); + iRes = SendCommand(qbSend); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = RecvData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = ParseData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + m_daDeviceAttr.iMaxIntegrationTimeInMS = (ZZ_U8)qbRecv[1] + (ZZ_U8)qbRecv[0] * 256; + + + iRes = SetExposureTime(m_daDeviceAttr.iMinIntegrationTimeInMS); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Call SetExposureTime error.Exit Code:2"; + return 2; + } + iRes = SingleShot(m_daDeviceAttr.iPixels); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Call SingleShot error.Exit Code:3"; + return 3; + } + + + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_WAVELENGTH_CALIBRATION_COEF); + qbSend.resize(3); + qbSend[1] = 0x00; + qbSend[2] = 0x01; + iRes = SendCommand(qbSend); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = RecvData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + iRes = ParseData(qbRecv); + if (iRes != 0) + { + qDebug() << "Err:GetDeviceAttribute Failed,Communication error.Exit Code:1"; + return 1; + } + float fWaveLengthCoef[4]; + memcpy(fWaveLengthCoef, qbRecv.data()+16, 4 * sizeof(float)); + for (int i=0;i< m_daDeviceAttr.iPixels;i++) + { + m_daDeviceAttr.fWaveLengthInNM[i] = fWaveLengthCoef[0] * i*i*i + fWaveLengthCoef[1] * i*i + fWaveLengthCoef[2] * i + fWaveLengthCoef[3]; + } + + Attr = m_daDeviceAttr; + + return 0; +} + +int ZZ_ATPControl_Serial_Qt::SetDeviceTemperature(float fTemperature) +{ + return 0; +} + +int ZZ_ATPControl_Serial_Qt::SendCommand(QByteArray qbCommand) +{ + int iSize = qbCommand.size() + 3; + QByteArray qbSend; + qbSend.resize(4); + qbSend[0] = (ZZ_U8)0xAA; + qbSend[1] = 0x55; + qbSend[2] = iSize / 256; + qbSend[3] = iSize % 256; + qbSend.append(qbCommand); + + int iSum = 0; + for (int i = 0; i < iSize - 1; i++) + { + iSum = iSum + qbSend[i + 2]; + } + + qbSend.append(iSum % 256); + + qint64 qi64Write= m_pSerialPort->write(qbSend); + if (qi64Write != qbSend.size()) + { + qDebug() << "Err:write Failed.Exit Code:1"<< qi64Write; + return 1; + } + + return 0; +} + +int ZZ_ATPControl_Serial_Qt::RecvData(QByteArray &qbData) +{ + qbData.clear(); + qbData = m_pSerialPort->readAll(); + + int iCounter = 0; + while (qbData.size() < 4) + { + m_pSerialPort->waitForReadyRead(50); + QByteArray qbTemp = m_pSerialPort->readAll(); + qbData.append(qbTemp); + + if (iCounter > 10) + { + qDebug() << "Err:RecvData Failed,Not Enough Data.Exit Code:1"<< qbData.size(); + return 1; + } + iCounter++; + } + + if ((ZZ_U8)qbData[0] != (ZZ_U8)0xaa || (ZZ_U8)qbData[1] != (ZZ_U8)0x55) + { + qDebug() << "Err:RecvData Failed,Wrong Header.Exit Code:2" << qbData.size(); + return 2; + } + + iCounter = 0; + int iLength = qbData[2] * 256 + qbData[3] + 2; + while (qbData.size() < iLength) + { + m_pSerialPort->waitForReadyRead(50); + qbData.append(m_pSerialPort->readAll()); + + if (iCounter > 100) + { + qDebug() << "Err:RecvData Failed,Incomplete Data.Exit Code:3" << qbData.size(); + return 3; + } + iCounter++; + } + + if (qbData.size() > iLength) + { + qbData.remove(iLength - 1, qbData.size() - iLength); + } + int iCheckSumLength = iLength - 3; + ZZ_U16 usCheckSum = 0; + for (int i = 0; i < iCheckSumLength; i++) + { + usCheckSum += qbData[i+2]; + } + usCheckSum = usCheckSum % 256; + ZZ_U8 ucTemp = qbData[qbData.size() - 1]; + if ((ZZ_U8)usCheckSum != ucTemp) + { + qDebug() << "Err:RecvData Failed,Incorrect Check Sum.Exit Code:4" << qbData.size(); + qbData.clear(); + return 4; + } + + return 0; +} + +int ZZ_ATPControl_Serial_Qt::ParseData(QByteArray &qbData) +{ + if (qbData.size() < 6) + { + qDebug() << "Err:ParseData Failed,Not Enough Data.Exit Code:1" << qbData.size(); + return 1; + } + qbData.remove(0, 5); + qbData.remove(qbData.size() - 1, 1); + return 0; +} + +int ZZ_ATPControl_Serial_Qt::PerformAutoExposure(float fMinScaleFactor, float fMaxScaleFactor, float &fPredictedExposureTime) +{ + using namespace ZZ_MATH; + int iDeviceDepth = 65535; + + bool bFlagIsOverTrying = false; + bool bFlagIsLowerMinExposureTime = false; + bool bFlagIsOverMaxExposureTime = false; + bool bFlagIsAutoExposureOK = false; + bool bFlagIsAutoExposureFailed = false; + + bool bIsValueOverflow = false; + bool bIsLastValueOverflow = false; + + float fExposureTime = 0; + float fTempExposureTime = 0; + double fLastExposureTime = 0.1; + int iRepeatCount = 0; + + int iRes = SetExposureTime(2000);//need change to load from files + if (iRes != 0) + { + qDebug() << "Err:PerformAutoExposure Failed.Exit Code:1"; + return 1; + } + + while (!bFlagIsAutoExposureOK && !bFlagIsAutoExposureFailed) + { + DataFrame dfTemp; + + if (iRepeatCount++ > 30) + { + bFlagIsAutoExposureFailed = true; + bFlagIsOverTrying = true; + break; + } + + fExposureTime = (float)m_daDeviceAttr.iMinIntegrationTimeInMS; + fTempExposureTime = fExposureTime; + + iRes = SingleShot(dfTemp); + if (iRes != 0) + { + qDebug() << "Err:PerformAutoExposure Failed.Exit Code:2"; + return 2; + } + + HeapSort(dfTemp.usData, m_daDeviceAttr.iPixels); + + double dSum = 0; + int iCount = m_daDeviceAttr.iPixels / 100; + for (int i = 0; i < iCount; i++) + { + dSum += dfTemp.usData[i]; + } + double dTemp = dSum / iCount; + + if (dTemp >= iDeviceDepth * 0.99) + { + bIsValueOverflow = true; + if (!bIsLastValueOverflow) + { + fExposureTime = (float)(fLastExposureTime + fExposureTime) / 2; + } + else + { + fExposureTime = fExposureTime / 2; + } + } + + else if (iDeviceDepth * fMaxScaleFactor >= dTemp && dTemp >= iDeviceDepth * fMinScaleFactor) + { + bFlagIsAutoExposureOK = 1; + } + else if (dTemp > iDeviceDepth * fMaxScaleFactor) + { + bIsValueOverflow = true; + if (!bIsLastValueOverflow) + { + fExposureTime = (float)(fLastExposureTime + fExposureTime) / 2; + } + else + { + fExposureTime = fExposureTime * 3 / 4; + } + } + else if (dTemp < iDeviceDepth * fMinScaleFactor) + { + bIsValueOverflow = false; + if (bIsLastValueOverflow) + { + fExposureTime = (float)(fLastExposureTime + fExposureTime) / 2; + } + else + { + double dFactor; + dFactor = dTemp / (iDeviceDepth * fMaxScaleFactor); + fExposureTime = (float)(fExposureTime / dFactor); + } + if (/*fExposureTime > 100 || */fExposureTime < 10) + { + bFlagIsAutoExposureOK = false; + bFlagIsAutoExposureFailed = true; + bFlagIsLowerMinExposureTime = true; + } + } + bIsLastValueOverflow = bIsValueOverflow; + fLastExposureTime = fTempExposureTime; + + if (fExposureTime > 13000) + { + bFlagIsAutoExposureOK = false; + bFlagIsAutoExposureFailed = true; + fPredictedExposureTime = 13000; + iRes = SetExposureTime(13000); + if (iRes != 0) + { + qDebug() << "Err:PerformAutoExposure Failed.Exit Code:3"; + return 3; + } + bFlagIsOverMaxExposureTime = true; + break; + } + + iRes = SetExposureTime((int)fExposureTime); + if (iRes != 0) + { + qDebug() << "Err:PerformAutoExposure Failed.Exit Code:4"; + return 3; + } + } + fPredictedExposureTime = fExposureTime; + return 0; +} + + + +// int ZZ_ATPControl_Serial_Qt::SetExtShutter(int iShutterUP0, int iShutterDOWN1, int iShutterDOWN2, int iShutterDOWN3) +// { +// qDebug() << "stub code not implemented"; +// return -1; +// } + +int ZZ_ATPControl_Serial_Qt::SetExposureTime(int iExposureTimeInMS) +{ + QByteArray qbExposureTime,qbRecv; + qbExposureTime.append(SET_INTEGRATION_TIME); + qbExposureTime.resize(3); + qbExposureTime[1] = iExposureTimeInMS >> 8; + qbExposureTime[2] = iExposureTimeInMS & 0xFF; + + SendCommand(qbExposureTime); + RecvData(qbRecv); + ParseData(qbRecv); + + if ((ZZ_U8)qbRecv[0] != 0) + { + qDebug() << "Err:SetExposureTime Failed.Exit Code:1" ; + return 1; + } + + return 0; +} + +int ZZ_ATPControl_Serial_Qt::GetExposureTime(int &iExposureTimeInMS) +{ + QByteArray qbSend, qbRecv; + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_INTEGRATION_TIME); + qbSend.resize(3); + qbSend[1] = 0x00; + qbSend[2] = 0x01; + SendCommand(qbSend); + RecvData(qbRecv); + ParseData(qbRecv); + return 0; +} + +int ZZ_ATPControl_Serial_Qt::SingleShot(DataFrame &dfData) +{ + QByteArray qbSend, qbRecv; + qbSend.clear(); + qbRecv.clear(); + qbSend.append(SYNC_GET_DATA); + qbSend.resize(3); + qbSend[1] = 0x00; + qbSend[2] = 0x01; + SendCommand(qbSend); + RecvData(qbRecv); + ParseData(qbRecv); + + if ((ZZ_U8)qbRecv[0] != 0) + { + qDebug() << "Err:SingleShot Failed.Exit Code:1"; + return 1; + } + else + { + int iDataSizeInPixel = (qbRecv.size() - 1) / 2; + memcpy(dfData.usData, qbRecv.data() + 1, iDataSizeInPixel * 2); + + } + + return 0; +} + +int ZZ_ATPControl_Serial_Qt::SingleShot(int &iPixels) +{ + QByteArray qbSend, qbRecv; + qbSend.clear(); + qbRecv.clear(); + qbSend.append(SYNC_GET_DATA); + qbSend.resize(3); + qbSend[1] = 0x00; + qbSend[2] = 0x01; + SendCommand(qbSend); + RecvData(qbRecv); + ParseData(qbRecv); + + if ((ZZ_U8)qbRecv[0] != 0) + { + qDebug() << "Err:SingleShot Failed.Exit Code:1"; + return 1; + } + else + { + iPixels = (qbRecv.size() - 1) / 2; + + } + return 0; +} + +// int ZZ_ATPControl_Serial_Qt::SingleShotDark(ATPDataFrame &dfData) +// { +// SetExtShutter(0,0,0,0); +// SingleShot(dfData); +// return 0; +// } + +int ZZ_ATPControl_Serial_Qt::GetDeviceTemperature(float &fTemperature) +{ + QByteArray qbSend, qbRecv; + qbSend.clear(); + qbRecv.clear(); + qbSend.append(GET_TEC_TEMP); + qbSend.resize(3); + qbSend[1] = 0x00; + qbSend[2] = 0x01; + SendCommand(qbSend); + RecvData(qbRecv); + ParseData(qbRecv); + return 0; +} + +//void ZZ_ATPControl_Serial_Qt::ReadMessage() +//{ +// QByteArray qbTemp, qbTemp1; +// qbTemp = m_pSerialPort->readAll(); +// while (qbTemp.size()<2) +// { +// m_pSerialPort->waitForReadyRead(50); +// qbTemp1 = m_pSerialPort->readAll(); +// qbTemp.append(qbTemp1); +// } + + + + //return; + // } diff --git a/othersoft/shuttercali/source/FS/ATPControl_Serial_QT.h b/othersoft/shuttercali/source/FS/ATPControl_Serial_QT.h new file mode 100644 index 0000000..dbb6456 --- /dev/null +++ b/othersoft/shuttercali/source/FS/ATPControl_Serial_QT.h @@ -0,0 +1,84 @@ +////////////////////////////////////////////////////////////////////////// +//ATP豸ͨ +////////////////////////////////////////////////////////////////////////// +#pragma once +#include "pch.h" +#include "ZZ_Types.h" +#include "IrisFiberSpectrometerBase.h" + +using namespace ZZ_MISCDEF; +using namespace ZZ_MISCDEF::ATP; +using namespace ZZ_MISCDEF::IRIS::FS; + +class ZZ_ATPControl_Serial_Qt:public CIrisFSBase +{ + //Q_OBJECT +public: + ZZ_ATPControl_Serial_Qt(); + virtual ~ZZ_ATPControl_Serial_Qt(); + +public: + //ò + //int SetBaudRate(int iBaud); + //ʼ豸 + int Initialize(bool bIsUSBMode, ZZ_U8 ucPortNumber, std::string strDeviceName); + //ر豸 + void Close(); + + //βԲɼ ȷ豸 + int SingleShot(int &iPixels); + + //ݲɼ + int SingleShot(DataFrame &dfData); + + //ΰɼ + //int SingleShotDark(ATPDataFrame &dfData); + + //int SingleShotDeducted(ATPDataFrame &dfData); + //عʱ + int SetExposureTime(int iExposureTimeInMS); + + //ȡعʱ + int GetExposureTime(int &iExposureTimeInMS); + + //int GetWaveLength(float *pfWaveLength); + + //ȡ豸Ϣ + int GetDeviceInfo(DeviceInfo &Info); + + //ȡ豸 + int GetDeviceAttribute(DeviceAttribute &Attr); + + //int GetDeviceListInfo(); //use type name to enum + + //¶ + int SetDeviceTemperature(float fTemperature); + + //ȡ¶ + int GetDeviceTemperature(float &fTemperature); + + //Զع + int PerformAutoExposure(float fMinScaleFactor, float fMaxScaleFactor, float &fPredictedExposureTime); + +#ifdef _DEBUG +public: +#else // +private: +#endif + //port + int m_iBaudRate; + QSerialPort *m_pSerialPort; + + //ATP + DeviceInfo m_diDeviceInfo; + DeviceAttribute m_daDeviceAttr; + + //////////////////////////////////////////////////////////////////////////shutter control stub code s + //int SetExtShutter(int iShutterUP0, int iShutterDOWN1,int iShutterDOWN2,int iShutterDOWN3); //0:close 1:open + //////////////////////////////////////////////////////////////////////////shutter control stub code e + int SendCommand(QByteArray qbCommand); + int RecvData(QByteArray &qbData); + int ParseData(QByteArray &qbData); +//private slots : + //void ReadMessage(); +}; \ No newline at end of file diff --git a/othersoft/shuttercali/source/FS/ATPDataFileProcessor.cpp b/othersoft/shuttercali/source/FS/ATPDataFileProcessor.cpp new file mode 100644 index 0000000..e69de29 diff --git a/othersoft/shuttercali/source/FS/ATPDataFileProcessor.h b/othersoft/shuttercali/source/FS/ATPDataFileProcessor.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/othersoft/shuttercali/source/FS/ATPDataFileProcessor.h @@ -0,0 +1 @@ +#pragma once diff --git a/othersoft/shuttercali/source/FS/IrisFiberSpectrometerBase.h b/othersoft/shuttercali/source/FS/IrisFiberSpectrometerBase.h new file mode 100644 index 0000000..ebf17d7 --- /dev/null +++ b/othersoft/shuttercali/source/FS/IrisFiberSpectrometerBase.h @@ -0,0 +1,42 @@ +#include +#include "ZZ_Types.h" +#pragma once +using namespace ZZ_MISCDEF; +using namespace ZZ_MISCDEF::IRIS::FS; + +class CIrisFSBase +{ +public: + //CIrisFSBase(); + //virtual ~CIrisFSBase()= 0; +public: + //ʼ豸 + //˴stringΪָĸoceanǵIJиΪc/c++׼ + //0Ϊ޴󣬲ͬ뷵زֵͬ + virtual int Initialize(bool bIsUSBMode,ZZ_U8 ucPortNumber,std::string strDeviceName) = 0; + + //ر豸 + virtual void Close() = 0; + + //ݲɼ + virtual int SingleShot(DataFrame &dfData) = 0; + + //عʱ + virtual int SetExposureTime(int iExposureTimeInMS) = 0; + + //ȡعʱ + virtual int GetExposureTime(int &iExposureTimeInMS) = 0; + + //Ŀ¶ + virtual int SetDeviceTemperature(float fTemperature) = 0; + + //ȡ¶ + virtual int GetDeviceTemperature(float &fTemperature) = 0; + + //ȡ豸Ϣ + virtual int GetDeviceInfo(DeviceInfo &Info) = 0; + + //ȡ豸 + virtual int GetDeviceAttribute(DeviceAttribute &Attr) = 0; + +}; diff --git a/othersoft/shuttercali/source/FS/ZZ_Types.h b/othersoft/shuttercali/source/FS/ZZ_Types.h new file mode 100644 index 0000000..7ad1c54 --- /dev/null +++ b/othersoft/shuttercali/source/FS/ZZ_Types.h @@ -0,0 +1,297 @@ +////////////////////////////////////////////////////////////////////////// +//˵ļ +////////////////////////////////////////////////////////////////////////// +#pragma once +#include "pch.h" +#include +#define MAX_DEVICENUMBER_FS 2 +#define MAX_LINEARSHUTTER_POSITION 12 +namespace ZZ_MISCDEF +{ + typedef unsigned char ZZ_U8; + typedef unsigned short int ZZ_U16; + typedef unsigned long int ZZ_U32; + + + namespace IRIS + { + //Fiber Spectrometer + namespace FS + { + typedef struct tagDataFrame + { + ZZ_U16 usExposureTimeInMS; + ZZ_U16 usData[4096]; + float fTemperature; + double dTimes = 0; + }DataFrame; + + typedef struct tagDeviceInfo + { + std::string strPN; + std::string strSN; + }DeviceInfo; + + typedef struct tagDeviceAttribute + { + int iPixels; + int iMaxIntegrationTimeInMS; + int iMinIntegrationTimeInMS; + float fWaveLengthInNM[4096]; + + }DeviceAttribute; + } + + enum DeviceModel + { + OSIFAlpha=0, + OSIFBeta, + ISIF, + IS1, + IS2 + }; + +// inline std::string GetDeviceModelName(int iModel) +// { +// switch (iModel) +// { +// case DeviceModel::OSIFAlpha: return "OSIFAlpha"; break; +// case DeviceModel::OSIFBeta: return "OSIFBeta"; break; +// case DeviceModel::ISIF: return "ISIF"; break; +// case DeviceModel::IS1: return "IS1"; break; +// case DeviceModel::IS2: return "IS2"; break; +// default: return "error"; break; +// } +// } +// +// inline int GetIndex(std::string strDeviceModelName) +// { +// if (strDeviceModelName== "OSIFAlpha") +// { +// return DeviceModel::OSIFAlpha; +// } +// else if (strDeviceModelName == "OSIFBeta") +// { +// return DeviceModel::OSIFBeta; +// } +// else if (strDeviceModelName == "ISIF") +// { +// return DeviceModel::ISIF; +// } +// else if (strDeviceModelName == "IS1") +// { +// return DeviceModel::IS1; +// } +// else if(strDeviceModelName == "IS2") +// { +// return DeviceModel::IS2; +// } +// else +// { +// return -1; +// } +// } + + }; + + //ATPָת + namespace ATP + { + const int MAX_SPECTRUM_SIZE = 4096; + + const int GET_MODULECIRCUIT_TEMP = 0x01; + const int GET_PN_NUMBER = 0x03; + const int GET_SN_NUMBER = 0x04; + const int GET_MANUFACTURE_DATA = 0x06; + const int GET_MANUFACTURE_INFO = 0x09; + const int GET_PIXEL_LENGTH = 0x0a; + const int GET_TEC_TEMP = 0x13; + const int SET_TEC_TEMP = 0x12; + const int GET_OPTICS_TEMP = 0x35; + const int GET_CIRCUITBOARD_TEMP = 0x36; + const int SET_INTEGRATION_TIME = 0x14; + const int GET_INTEGRATION_TIME = 0x41; + const int GET_MAX_INTEGRATION_TIME = 0x42; + const int GET_MIN_INTEGRATION_TIME = 0x43; + const int ASYNC_COLLECT_DARK = 0x23; + const int ASYNC_START_COLLECTION = 0x16; + const int ASYNC_READ_DATA = 0x17; + const int SET_AVERAGE_NUMBER = 0x28; + const int SYNC_GET_DATA = 0x1e; + const int SYNC_GET_DARK = 0x2f; + const int EXTERNAL_TRIGGER_ENABLE = 0x1f; + const int SET_XENON_LAMP_DELAY_TIME = 0x24; + const int GET_WAVELENGTH_CALIBRATION_COEF = 0x55; + const int GET_STAT_LAMPOUT = 0x60; + const int SET_GPIO = 0x61; + //const int SYNCHRONIZATION_GET_DARK = 0x23 + + //////////////////////////////////////////////////////////////////////////device + enum Model + { + ATP1010 = 0, + ATP6500 + }; + + //֡ + typedef struct tagATPDataFrame + { + unsigned short usExposureTime; + ZZ_U16 usData[4096]; + float fTemperature; + double dTimes = 0; + }ATPDataFrame; + + //豸Ϣ + typedef struct tagATPDeviceInfo + { + std::string strPN; + std::string strSN; + }ATPDeviceInfo; + + //豸 + typedef struct tagATPDeviceAttribute + { + int iPixels; + int iMaxIntegrationTime; + int iMinIntegrationTime; + float fWaveLength[4096]; + + }ATPDeviceAttribute; + //////////////////////////////////////////////////////////////////////////config file + + + + } + + //в + namespace ZZ_RUNPARAMS + { + typedef struct tagFiberSpecContext + { + ZZ_U8 ucDeviceNumber; + ZZ_U8 ucDeviceModel[MAX_DEVICENUMBER_FS]; + int iInterface[MAX_DEVICENUMBER_FS]; + std::string strSN[MAX_DEVICENUMBER_FS]; + }FSContext; + + typedef struct tagLinearShutterContext + { + ZZ_U8 ucPort; + ZZ_U8 ucProtocolType; + ZZ_U8 ucCmdID; + }LSContext; + + typedef struct tagAcquisitionTimeSettings + { + QTime qtStartTime; + QTime qtStopTime; + QTime qtInterval; + }AcqTimeSettings; + + typedef struct tagAcquisitionPositionSettings + { + int iTotalPosition; + int iPosition[MAX_LINEARSHUTTER_POSITION]; + }AcqPosSettings; + + typedef struct tagRunTimeGrabberParams + { + LSContext lscParam; + FSContext fscParams; + AcqTimeSettings atsParams; + AcqPosSettings apsParams; + }RunTimeGrabberParams; + + typedef struct tagATPCalibrationSettings + { + //Up0 Down1,2,3 + QString qsISIF_CalibrationFilePath[4]; + QString qsIS1_CalibrationFilePath[4]; + }ATPCalibrationSettings; + } + + //ϵͳļṹ + namespace ZZ_DATAFILE + { + typedef struct tagEnvironmentalContext + { + QString qstrUTCDateTime; + QString qstrLocation; + QString qstrGPS_Longtitude; + QString qstrGPS_Latitude; + QString qstrGPS_Altitude; + QString qstrGPS_North; + QString qstrCaseTemperature; + QString qstrCaseHumidity; + + }EContext; + + typedef struct tagManmadeEnviromentalContext + { + QString qstrOriFileName; + QString qstrInstallationTime; + QString qstrISIFCalibrationTime; + QString qstrIS1CalibrationTime; + QString qstrNameOfMaintenanceStaff; + QString qstrPhoneNumberOfMaintenanceStaff; + QString qstrDownloadUserID; + QString qstrDownlaodAddress; + QString qstrHTTPServer; + }MEContext; + + + typedef struct tagIS1Information + { + QString qstrSN_ATP; + QString qstrSN_IRIS; + + QString qstrCalFile_U0; + QString qstrCalFile_D1; + QString qstrCalFile_D2; + QString qstrCalFile_D3; + + int iPixelCount; + + int iExposureTimeInMS_U0; + int iExposureTimeInMS_D1; + int iExposureTimeInMS_D2; + int iExposureTimeInMS_D3; + + float fTemperature_U0; + float fTemperature_D1; + float fTemperature_D2; + float fTemperature_D3; + }IS1Info; + + typedef struct tagISIFInformation + { + QString qstrSN_ATP; + QString qstrSN_IRIS; + + QString qstrCalFile_U0; + QString qstrCalFile_D1; + QString qstrCalFile_D2; + QString qstrCalFile_D3; + + int iPixelCount; + + int iExposureTimeInMS_U0; + int iExposureTimeInMS_D1; + int iExposureTimeInMS_D2; + int iExposureTimeInMS_D3; + + float fTemperature_U0; + float fTemperature_D1; + float fTemperature_D2; + float fTemperature_D3; + }ISIFInfo; + + typedef struct tagATPDataHeader + { + + + }ATPDataHeader; + } + +}; diff --git a/othersoft/shuttercali/source/LinearShutter/AbstractPort.h b/othersoft/shuttercali/source/LinearShutter/AbstractPort.h new file mode 100644 index 0000000..0c0118b --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/AbstractPort.h @@ -0,0 +1,16 @@ +#pragma once +#include "VSMD12XMiscDefines.h" +#include +class CAbstractPort +{ +public: + virtual void InitPort(PortInfo portinfo) = 0; + virtual bool SetPort() = 0; + virtual bool Open() = 0; + virtual void Close() = 0; + + virtual std::string ReadAll(int waite=5000) = 0; + virtual int Write(const std::string strSend) = 0; + +}; + diff --git a/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.cpp b/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.cpp new file mode 100644 index 0000000..4013b30 --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.cpp @@ -0,0 +1,1415 @@ +#include "pch.h" +#include "VSMD12XControl.h" +#include "ZZ_SeiralPort.h" +#include +#define sprintf_s snprintf +CVSMD12XControl::CVSMD12XControl() +{ + m_iProtocolType = 0; + m_iCID = 1; + m_bIsSyncMove = 0; + m_piPositionInPulses = NULL; + waitetime = 200; + waitetime = 200; +} + +CVSMD12XControl::~CVSMD12XControl() +{ + if (m_piPositionInPulses!=NULL) + { + delete[] m_piPositionInPulses; + } +} + +bool CVSMD12XControl::ILMES_InitializeComm(PortInfo portinfo, int iPortType /*= 1*/, int iCID /*= 1*/, bool bSyncMove /*= true*/) +{ + SetProtocolType(iPortType); + SetCID(iCID); + SetSyncMode(bSyncMove); + + return InitAndOpenPort(portinfo); +} +bool CVSMD12XControl::ILMES_InitializeComm(QString portName, int bandrate, int iPortType , int iCID , bool bSyncMove ) +{ + PortInfo pi; + pi.FullPortName = portName; + pi.iBaudRate = bandrate; + return ILMES_InitializeComm(pi, iPortType, iCID, bSyncMove); + + +} + +bool CVSMD12XControl::ILMES_InitializeParams(ControllerParams cpParams) +{ + bool bRes = false; + + bRes = CVSMD12XControl::SetBaudRate(cpParams.bdr); + if (!bRes) + { + qDebug() << "SetBaudRate Err"; + //return false; + } + + bRes = CVSMD12XControl::SetSpeed(cpParams.spd,cpParams.acc,cpParams.dec); + if (!bRes) + { + qDebug() << "SetSpeed Err"; + //return false; + } + + bRes = CVSMD12XControl::SetMicroSteps(cpParams.mcs); + if (!bRes) + { + qDebug() << "SetMicroSteps Err"; + //return false; + } + + bRes = CVSMD12XControl::SetCurrent(cpParams.cra,cpParams.crn,cpParams.crh); + if (!bRes) + { + qDebug() << "SetCurrent Err"; + //return false; + } + + bRes = CVSMD12XControl::SetZeroParams(cpParams.zmd,cpParams.osv, cpParams.snr,cpParams.zsd,cpParams.zsp); + if (!bRes) + { + qDebug() << "SetZeroParams Err"; + //return false; + } + return bRes; +} + +void CVSMD12XControl::ILMES_SetPosition(int *piPositionInPulse, size_t szSize) +{ + m_piPositionInPulses = new int[szSize]; + for (size_t i=0;i< szSize;i++) + { + m_piPositionInPulses[i] = piPositionInPulse[i]; + } +} + +bool CVSMD12XControl::ILMES_MoveToPos(int iPositionIndex) +{ + bool bRes = false; + bRes = CVSMD12XControl::StartBackZero(); + if (!bRes) + { + qDebug() << "StartBackZero Err"; + return false; + } + + bRes = CVSMD12XControl::MoveTo(m_piPositionInPulses[iPositionIndex]); + if (!bRes) + { + qDebug() << "MoveTo Err"; + return false; + } + + return bRes; +} + +void CVSMD12XControl::SetProtocolType(int iProtocolType /*= 0*/) +{ + m_iProtocolType = iProtocolType; +} + +void CVSMD12XControl::SetCID(int iID) +{ + m_iCID = iID; + + char cmd[64]; + sprintf_s(cmd, 64, "%d ", iID); + std::string strCID(cmd); + m_strCID = strCID; + return; +} + +void CVSMD12XControl::SetSyncMode(bool bSyncMove /*= false*/) +{ + m_bIsSyncMove = bSyncMove; +} + +bool CVSMD12XControl::InitAndOpenPort(PortInfo portinfo) +{ + bool bRes = false; + if (portinfo.iPortType==0) + { + m_pAbsPort = new CZZ_SeiralPort_QT; + } + + m_pAbsPort->InitPort(portinfo); + + bRes = m_pAbsPort->SetPort(); + if (!bRes) + { + return bRes; + } + bRes = m_pAbsPort->Open(); + return bRes; +} + +std::string CVSMD12XControl::ReadReceive() +{ + return m_pAbsPort->ReadAll(); +} + +int CVSMD12XControl::SendCommand(const std::string strSend) +{ + return m_pAbsPort->Write(strSend); +} + +bool CVSMD12XControl::InitController() +{ +// std::string strTest = "this is a test message."; +// +// char *pcTest = new char[strTest.length()]; +// strTest.copy(pcTest, strTest.length(),0); +// +// memcpy(pcTest, strTest.c_str(), 23); +// +// char *pcTest1 = (char*)strTest.c_str(); +// std::string test=m_pAbsPort->ReadAll(); + std::string strCMD = "dev\n"; + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + int iRet=m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + std::string strRecv = m_pAbsPort->ReadAll(); + ParseReturnedString(strRecv, 0); + std::string::size_type szPosition; + szPosition = strRecv.find("VSMD", 0); + if (szPosition != strRecv.npos) + { + return true; + } + return false; +} + +bool CVSMD12XControl::GetStatus(MSInfo &stuMotorParam) +{ + std::string strCMD = "cts\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + + //QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + ParseReturnedParam(strRecv); + + stuMotorParam = m_stuMSInfo; + return true; +} + +bool CVSMD12XControl::Move(int iRelPulse) +{ + using namespace ZZ_MISCDEF; + char cmd[64]; + sprintf_s(cmd, 64, "rmv %d\n", iRelPulse); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + QThread::msleep(200); + m_pAbsPort->ReadAll(); + if (m_bIsSyncMove) + { + if (iRet != 0) + { + return false; + } + + bool bFlagIsStopped=false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag==0x10 && m_stuMSInfo.fVelocity==0) + { + bFlagIsStopped = true; + } + } + return true; + } + else + { + if (iRet == 0) + { + return true; + } + return false; + } + +} + +bool CVSMD12XControl::Enable() +{ + std::string strCMD = "ena\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::Disable() +{ + std::string strCMD = "off\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); + +} + +bool CVSMD12XControl::MoveTo(int iAbsPulse) +{ + if (iAbsPulse > MAXDISTANCE) + { + //return false; + iAbsPulse = MAXDISTANCE; + } + + char cmd[64]; + sprintf_s(cmd, 64, "pos %d\n", iAbsPulse); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + + int iRet = m_pAbsPort->Write(strCMD); + if (waitetime!=0) + { + QThread::msleep(200); + } + + + m_pAbsPort->ReadAll(); + + if (m_bIsSyncMove) + { + if (iRet != 0) + { + return false; + } + + bool bFlagIsStopped = false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag == 0x10 && m_stuMSInfo.fVelocity == 0) + { + bFlagIsStopped = true; + } + } + return true; + } + else + { + if (iRet == 0) + { + return true; + } + return false; + } +// if (iRet == 0) +// { +// return true; +// } +// return false; +// std::string strTest; +// strTest.resize(7); +// char test[7]; +// //memcpy(test, strCMD.c_str(), 7); +// for (size_t i = 0; i < 7; i++) +// { +// strTest[i] = cmd[i]; +// } +} + +bool CVSMD12XControl::Move_NoSyn(int iRelPulse) +{ + bool a; + waitetime = 0; + m_bIsSyncMove = false; + a = Move(iRelPulse); + m_bIsSyncMove = true; + waitetime = 200; + return a; + +} + +bool CVSMD12XControl::MoveTo_NoSyn(int iAbsPulse) +{ + bool a; + waitetime = 0; + m_bIsSyncMove = false; + a = MoveTo(iAbsPulse); + m_bIsSyncMove = true; + waitetime =200; + return a; +} + +bool CVSMD12XControl::SetLogicZero() +{ + std::string strCMD = "org\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::StartBackZero() +{ + std::string strCMD = "zero start\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + + if (!ParseReturnedString(strRecv, -1)) + { + return false; + } + + bool bFlagIsStopped = false; + while (!bFlagIsStopped) + { + QThread::msleep(200); + GetStatus(m_stuMSInfo); + ZZ_U8 ucFlag = m_stuMSInfo.uiFlags & 0x000000FF; + ucFlag = ucFlag & 0x10; + if (ucFlag == 0x10 && m_stuMSInfo.fVelocity == 0) + { + bFlagIsStopped = true; + } + } + return true; +// return ParseReturnedString(strRecv, -1); + +} + +bool CVSMD12XControl::StopBackZero() +{ + std::string strCMD = "zero stop\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(200); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetBaudRate(int iBaudRate) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg bdr=%d\n", iBaudRate); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +int CVSMD12XControl::GetBaudRate() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes= ParseReturnedParam(strRecv); + if (bRes=false) + { + return -1; + } + else + { + return m_stuControllerParams.bdr; + } +} + +bool CVSMD12XControl::SetMicroSteps(int iMicroSteps) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg mcs=%d\n", iMicroSteps); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +int CVSMD12XControl::GetMicroSteps() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.mcs; + } +} + +bool CVSMD12XControl::SetAccSpeed(float fAccSpd) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg acc=%f\n", fAccSpd); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetAccSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.acc; + } +} + +bool CVSMD12XControl::SetRunSpeed(float fRunSpeed) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg spd=%f\n", fRunSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetRunSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.spd; + } +} + +bool CVSMD12XControl::SetDecSpeed(float fDecSpeed) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg dec=%f\n", fDecSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetDecSpeed() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.dec; + } +} + +bool CVSMD12XControl::SetSpeed(float fRunSpeed, float fAccSpd, float fDecSpeed) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg spd=%f acc=%f dec=%f\n", fRunSpeed, fAccSpd, fDecSpeed); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetHoldCurrent(float fHoldCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg crh=%f\n", fHoldCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetHoldCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.crh; + } +} + +bool CVSMD12XControl::SetAccCurrent(float fAccCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg cra=%f\n", fAccCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetAccCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.cra; + } +} + +bool CVSMD12XControl::SetRunCurrent(float fRunCurrent) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg crn=%f\n", fRunCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +float CVSMD12XControl::GetRunCurrent() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.crn; + } +} + +bool CVSMD12XControl::SetCurrent(float fAccCurrent, float fRunCurrent, float fHoldCurrent) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg cra=%f crn=%f crh=%f\n", fAccCurrent, fRunCurrent, fHoldCurrent); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +bool CVSMD12XControl::SetS1FETE(ZZ_U8 bS1FETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s1f=%d\n", bS1FETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS1FETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s1f; + } +} + +bool CVSMD12XControl::SetS1RETE(ZZ_U8 bS1RETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s1r=%d\n", bS1RETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS1RETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s1r; + } +} + +bool CVSMD12XControl::SetS2FETE(ZZ_U8 bS2FETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s2f=%d\n", bS2FETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS2FETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s2f; + } +} + +bool CVSMD12XControl::SetS2RETE(ZZ_U8 bS2RETE) +{ + char cmd[64]; + sprintf_s(cmd, 64, "cfg s2r=%d\n", bS2RETE); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetS2RETE() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.s2r; + } +} + +bool CVSMD12XControl::SetZeroParams(ZZ_U8 bZeroMode, ZZ_U8 bSwitchOpenVL, ZZ_U8 bZeroSensor, float fZeroVelocity, int iSafePosition) +{ + char cmd[128]; + sprintf_s(cmd, 128, "cfg zmd=%d osv=%d snr=%d zsd=%f zsp=%d\n", + (int)bZeroMode, (int)bSwitchOpenVL, (int)bZeroSensor, fZeroVelocity, iSafePosition); + std::string strCMD(cmd); + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(800); + + std::string strRecv = m_pAbsPort->ReadAll(); + + return ParseReturnedString(strRecv, -1); +} + +ZZ_U8 CVSMD12XControl::GetZeroMode() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zmd; + } +} + +ZZ_U8 CVSMD12XControl::GetSwitchOpenVoltageLevel() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.osv; + } +} + +ZZ_U8 CVSMD12XControl::GetZeroSensor() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.snr; + } +} + +int CVSMD12XControl::GetSafePosition() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zsp; + } +} + +float CVSMD12XControl::GetZeroVelocity() +{ + std::string strCMD = "cfg\n"; + + if (m_iProtocolType) + { + strCMD = m_strCID + strCMD; + } + + int iRet = m_pAbsPort->Write(strCMD); + + QThread::msleep(500); + + std::string strRecv = m_pAbsPort->ReadAll(); + bool bRes = ParseReturnedParam(strRecv); + if (bRes = false) + { + return -1; + } + else + { + return m_stuControllerParams.zsp; + } +} + +bool CVSMD12XControl::ParseReturnedString(std::string &strRecv, int iType) +{ + char cHead =(char) 0xFF; + if (iType == -1) + { + if (strRecv[0]== cHead) + { + return true; + } + return false; + } + else if (iType == 0) + { + if (strRecv.size()<3) + { + return false; + } + strRecv.erase(0, 3); + strRecv.erase(strRecv.size() - 3, 3); + return true; + } + else + { + return false; + } +} + +bool CVSMD12XControl::ParseReturnedParam(std::string &strRecv) +{ + + + + while (uchar( strRecv[0])!=0xff&&strRecv.size()>0) + { + //std::cout << strRecv.size() << endl; + strRecv.erase(strRecv.begin()); + //std::cout << strRecv.size() << endl; + + } + int ii = 0; + while (strRecv.size() < 2) + { + + std::string strRecv1 = m_pAbsPort->ReadAll(20); + if (strRecv1.size() == 0) + { + return false; + + } + strRecv = strRecv + strRecv1; + ii++; + if (ii == 2) + { + return false; + + } + } + if (strRecv[2]==0x2) + { + //strRecv.erase(0, 3); + //strRecv.erase(strRecv.size() - 3, 3); + int i = 0; + int izero = 0; + while (strRecv.size() != 21) + { + std::string strRecv1 = ""; + strRecv1 = m_pAbsPort->ReadAll(20); + if (strRecv1.size()==0) + { + return false; + + } + strRecv = strRecv + strRecv1; + i++; + if (i==5) + { + return false; + + } + if (strRecv.size() > 21) + { + return false; + } + //return false; + } + ZZ_U8 *pbRecv = (ZZ_U8*)strRecv.c_str(); + + VSMD_BitShift(&pbRecv[3], &m_unValue); + m_stuMSInfo.fVelocity = m_unValue.fValue; + VSMD_BitShift(&pbRecv[8], &m_unValue); + m_stuMSInfo.iPosition = m_unValue.i32Value; + VSMD_BitShift(&pbRecv[13], &m_unValue); + m_stuMSInfo.uiFlags = m_unValue.u32Value; + + //delete pbRecv; + return true; + } + else if (strRecv[2] == 0x3) + { + strRecv[strRecv.size() - 3] = 0; + char* pcParam = ((char*)strRecv.c_str())+3; + + while (pcParam) + { + char* pcNext = VSMD_Split(pcParam, ' '); + char* pcValueStr = VSMD_Split(pcParam, '='); + + // + if (pcValueStr) + { + if (strcmp(pcParam, "bdr") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.bdr = iValue; + } + else if (strcmp(pcParam, "mcs") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.mcs = iValue; + } + else if (strcmp(pcParam, "spd") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.spd = fValue; + } + else if (strcmp(pcParam, "acc") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.acc = fValue; + } + else if (strcmp(pcParam, "dec") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.dec = fValue; + } + else if (strcmp(pcParam, "cra") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.cra = fValue; + } + else if (strcmp(pcParam, "crn") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.crn = fValue; + } + else if (strcmp(pcParam, "crh") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.crh = fValue; + } + else if (strcmp(pcParam, "s1f") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s1f = iValue; + } + else if (strcmp(pcParam, "s1r") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s1r = iValue; + } + else if (strcmp(pcParam, "s2f") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s2f = iValue; + } + else if (strcmp(pcParam, "s2r") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.s2r = iValue; + } + else if (strcmp(pcParam, "zmd") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.zmd = iValue; + } + else if (strcmp(pcParam, "osv") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.osv = iValue; + } + else if (strcmp(pcParam, "snr") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.snr = iValue; + } + else if (strcmp(pcParam, "zsd") == 0) + { + float fValue = (float)atof(pcValueStr); + m_stuControllerParams.zsd = fValue; + } + else if (strcmp(pcParam, "zsp") == 0) + { + int iValue = atoi(pcValueStr); + m_stuControllerParams.zsp = iValue; + } + + } + pcParam = pcNext; + } + return true; + } + + return false; +} + +void CVSMD12XControl::VSMD_BitShift(ZZ_U8* src, unValue* dst) +{ + if (src) + { + dst->u32Value = src[0]; + + dst->u32Value <<= 7; + dst->u32Value |= src[1]; + + dst->u32Value <<= 7; + dst->u32Value |= src[2]; + + dst->u32Value <<= 7; + dst->u32Value |= src[3]; + + dst->u32Value <<= 7; + dst->u32Value |= src[4]; + } +} + +char* CVSMD12XControl::VSMD_Split(char* cStr, char cSplit) +{ + if (cStr) + { + for (char* cPtr = cStr; *cPtr; cPtr++) + { + if (*cPtr == cSplit) + { + *cPtr = '\0'; + cPtr++; + return cPtr; + } + } + } + + return NULL; +} + +// int CVSMD12XControl::add(int a, int b) +// { +// return a + b; +// } diff --git a/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.h b/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.h new file mode 100644 index 0000000..46e6a5f --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/VSMD12XControl.h @@ -0,0 +1,146 @@ +#pragma once +#include "pch.h" +#include "AbstractPort.h" +using namespace std; +// #ifdef IRIS_API_EXPORTS +// +// #ifdef __cplusplus +// #define IRIS_API_FUNC extern "C" __declspec(dllexport) +// #else +// #define IRIS_API_FUNC __declspec(dllexport) +// #endif +// +// #else +// +// #ifdef __cplusplus +// #define IRIS_API_FUNC extern "C" __declspec(dllimport) +// #else +// #define IRIS_API_FUNC __declspec(dllimport) +// #endif +// +// #endif +// +// +// #ifdef IRIS_API_EXPORTS +// #define IRIS_API_CLASS __declspec(dllexport) +// #else +// #define IRIS_API_CLASS __declspec(dllimport) +// #endif +#define MAXDISTANCE 1265000 +class /*IRIS_API_CLASS*/ CVSMD12XControl +{ +public: + CVSMD12XControl(); + ~CVSMD12XControl(); +private: + int *m_piPositionInPulses; + + CAbstractPort *m_pAbsPort; + unValue m_unValue; + MSInfo m_stuMSInfo; + ControllerParams m_stuControllerParams; + int m_iProtocolType; + int m_iCID; + std::string m_strCID; +public: + bool m_bIsSyncMove; + ////////////////////////////////////////////////////////////////////////// + //for IRIS Linear Motor - Electric Shutter + //Initialize communication setup iPortType(0:RS232 1:RS485) iCID(For RS485 device) bSyncMove(move mode) + bool ILMES_InitializeComm(QString portName,int bandrate=9600, int iPortType = 1, int iCID = 1, bool bSyncMove = true); + //Initialize communication setup iPortType(0:RS232 1:RS485) iCID(For RS485 device) bSyncMove(move mode) + bool ILMES_InitializeComm(PortInfo portinfo,int iPortType = 1,int iCID = 1, bool bSyncMove = true); + + //Initialize Controller params + bool ILMES_InitializeParams(ControllerParams cpParams); + + //Set the light hole position(pulses) + void ILMES_SetPosition(int *piPositionInPulse,size_t szSize); + + bool ILMES_MoveToPos(int iPositionIndex); + +public: + int waitetime; + ////init port + void SetProtocolType(int iProtocolType = 0);//0:RS232 1:RS485 call before send any command + void SetCID(int iID);//set device id when using RS485 protocol call before send any command + void SetSyncMode(bool bSyncMove = false); + bool InitAndOpenPort(PortInfo portinfo);//Init comport by PortInfo Struct + + //////////////////////////////////////////////////////////////////////////for debug or unsupported function + std::string ReadReceive(); + int SendCommand(const std::string strSend); // return indicates how many char has been sent + //////////////////////////////////////////////////////////////////////////motor control + ////init&misc + bool InitController(); //Init Motor controller hand shake + + bool Enable(); //enbale + bool Disable(); //disable + + bool GetStatus(MSInfo &stuMotorParam); //load motor status see MSInfo Struct + ////motion control + bool Move(int iRelPulse); // relative move mode,pulse (-21474836472147483647) + bool MoveTo(int iAbsPulse);//absolute mode,pulse (-21474836472147483647) + bool Move_NoSyn(int iRelPulse); // relative move mode,pulse (-21474836472147483647) + bool MoveTo_NoSyn(int iAbsPulse);//absolute mode,pulse (-21474836472147483647) + bool SetLogicZero(); //set logic zero + + bool StartBackZero();//back zero + bool StopBackZero();// stop back zero & reset register + ////Set&Get + bool SetBaudRate(int iBaudRate);//set controller baud rates,default B9600 (2400 921600) + int GetBaudRate(); // -1:should retry; + + bool SetMicroSteps(int iMicroSteps);//set micro steps (05)->(1/2/4/8/16/32) + int GetMicroSteps(); + + bool SetAccSpeed(float fAccSpd);//set acceleration speed in pulse (0 192000000) + float GetAccSpeed(); + + bool SetRunSpeed(float fRunSpeed);//set normal running speed in pulse (0 192000000) + float GetRunSpeed(); + + bool SetDecSpeed(float fDecSpeed);//set deceleration speed in pulse (0 192000000) + float GetDecSpeed(); + + bool SetSpeed(float fRunSpeed, float fAccSpd, float fDecSpeed);//see above three functions + + bool SetHoldCurrent(float fHoldCurrent);//set hold current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetHoldCurrent(); + + bool SetAccCurrent(float fAccCurrent);//set acceleration current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetAccCurrent(); + + bool SetRunCurrent(float fRunCurrent);//set normal running current ( 0 8.0 )Amp? pay attention to your motor specification. + float GetRunCurrent(); + + bool SetCurrent(float fAccCurrent, float fRunCurrent, float fHoldCurrent);//see above three functions + + bool SetS1FETE(ZZ_U8 bS1FETE);//S1 register falling edge trigger event,see enum + ZZ_U8 GetS1FETE(); + + bool SetS1RETE(ZZ_U8 bS1RETE);//S1 register rising edge trigger event + ZZ_U8 GetS1RETE(); + + bool SetS2FETE(ZZ_U8 bS2FETE);//S2 register falling edge trigger event + ZZ_U8 GetS2FETE(); + + bool SetS2RETE(ZZ_U8 bS2RETE);//S2 register rising edge trigger event + ZZ_U8 GetS2RETE(); + + //(ZeroMode 0:off 1:once 2:once + safe position 3:twice 4:twice + safe position) (OpenVoltageLevel 0:Low Level 1:High Level) + //(ZeroSensor 0:S1 1:S2 2:S3 3:S4 4:S5 5:S6)( ZeroVelocity -192000) 192000pulse)(SafePosition -2147483647) 2147483647) + bool SetZeroParams(ZZ_U8 bZeroMode, ZZ_U8 bSwitchOpenVL, ZZ_U8 bZeroSensor, float fZeroVelocity, int iSafePosition); + ZZ_U8 GetZeroMode(); + ZZ_U8 GetSwitchOpenVoltageLevel(); + ZZ_U8 GetZeroSensor(); + int GetSafePosition(); + float GetZeroVelocity(); + +private: + bool ParseReturnedString(std::string &strRecv,int iType); + bool ParseReturnedParam(std::string &strRecv); + void VSMD_BitShift(ZZ_U8* src, unValue* dst); + char* VSMD_Split(char* cStr, char cSplit); +}; + diff --git a/othersoft/shuttercali/source/LinearShutter/VSMD12XMiscDefines.h b/othersoft/shuttercali/source/LinearShutter/VSMD12XMiscDefines.h new file mode 100644 index 0000000..92e2ac2 --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/VSMD12XMiscDefines.h @@ -0,0 +1,108 @@ +#pragma once +#include "ZZ_Types.h" +#define MAXBUFFER 10240 +#include +using namespace ZZ_MISCDEF; + +typedef struct tagTransportLayerInfomation +{ + //Serial + int iPortType; + int iPortNumber; + int indexBaudRate; + int iBaudRate; + int indexParity, indexBytesize, indexStopBits; //Mode + bool Hw; + bool Sw; + bool Dtr, Rts; + QString FullPortName; + tagTransportLayerInfomation() { + iPortType = 0; + indexParity = 0; + iPortNumber = 8; + iBaudRate = 9600; + indexBytesize = 3; + indexStopBits = 0; + FullPortName = ""; + } + + //Bit + //Stop + //MODEM CONTROL setting + //MODEM LINE STATUS + + //TCP UDP + +}PortInfo; + +typedef struct tagMotorStatusInfo +{ + float fVelocity; + int iPosition; + ZZ_U32 uiFlags; +}MSInfo; + +typedef struct tagControllerParams +{ + int bdr; //baud + int mcs; //microsteps 0:full 1:half 2:4 3:8 4:16 5:32 6:64 7:128 8:256 + float spd; //velocity + float acc; //acceleration + float dec; //deceleration + float cra; //acc state current + float crn; //normal state current + float crh; //hold state current + ZZ_U8 s1f; + ZZ_U8 s1r; + ZZ_U8 s2f; + ZZ_U8 s2r; + ZZ_U8 zmd; //zero mode + ZZ_U8 osv; //open state sensor value + ZZ_U8 snr; //zero sensor + ZZ_U8 zsp; //zero safe position + float zsd; //zero velocity + tagControllerParams() { + bdr = 9600; + + cra = 0.8; + crh = 0.4; + crn = 0.6; + + acc = 100000; + dec = 100000; + spd = 64000; + + osv = 0; + snr = 0; + zmd = 3; + zsp = 20; + zsd = 50000; + + mcs = 6; + } +}ControllerParams; + +typedef union +{ + ZZ_U8 byteValue[4]; + short i16Value[2]; + ZZ_U16 u16Value[2]; + int i32Value; + float fValue; + ZZ_U32 u32Value; +}unValue; + +enum emVSMDTriggerEvent +{ + NoAction =0, //޶ֻ״̬λ S1 仯֪ͨ + ResetZeroPosition, //ԭλ + DecSpdStop, //ֹͣ + DecSpdStopRZP, //ֹֹͣͣԭλ + Stop, //ֹͣ + StopRZP, //ֹֹͣͣԭλ + RunningPosDirect, //תٶȣ + RunningNegDirect, //תٶȣ + OfflineModeOn, //ģʽ + OfflineModeOff //ģʽֹͣ +}; + diff --git a/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.cpp b/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.cpp new file mode 100644 index 0000000..d5767ad --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.cpp @@ -0,0 +1,147 @@ +#include "pch.h" +#include "ZZ_SeiralPort.h" + +CZZ_SeiralPort_QT::CZZ_SeiralPort_QT() +{ + m_pSerialPort = new QSerialPort(); +} + +CZZ_SeiralPort_QT::~CZZ_SeiralPort_QT() +{ + if (m_pSerialPort != NULL) + { + delete m_pSerialPort; + } +} + + void CZZ_SeiralPort_QT::InitPort(PortInfo portinfo) +{ + + m_piSettings = portinfo; + + +} + + bool CZZ_SeiralPort_QT::SetPort() + { + bool bRes = true; +// int iRes = sio_ioctl(m_piSettings.iPortNumber, m_piSettings.indexBaudRate, +// m_piSettings.indexParity | m_piSettings.indexBytesize | m_piSettings.indexStopBits); +// if (iRes != SIO_OK) +// { +// bRes = false; +// } + QString qstrPortName; + if (m_piSettings.FullPortName!="") + { + qstrPortName = m_piSettings.FullPortName; + qDebug() << m_piSettings.FullPortName; + } + else { + qstrPortName = QString("COM%1").arg(m_piSettings.iPortNumber); + } + // qstrPortName = "COM4"; + // QString qstrPortName = m_piSettings.FullPortName;//QString("COM%1").arg(m_piSettings.iPortNumber); + m_pSerialPort->setPortName(qstrPortName); + m_pSerialPort->setReadBufferSize(512); + bRes = m_pSerialPort->setBaudRate(m_piSettings.iBaudRate); + return bRes; + } + +bool CZZ_SeiralPort_QT::Open() +{ + bool bRes = true; +// int iRes = sio_open(m_piSettings.iPortNumber); +// if (iRes!=SIO_OK) +// { +// bRes = false; +// } + bRes = m_pSerialPort->open(QIODevice::ReadWrite); + if (!bRes) + { + qDebug() << "Err:open Failed.Exit Code:1"; + //std::cout << "Err.open Failed" << std::endl; + return bRes;; + } + return bRes; +} + +void CZZ_SeiralPort_QT::Close() +{ + m_pSerialPort->close(); +} + +std::string CZZ_SeiralPort_QT::ReadAll(int waite) +{ + if (!m_pSerialPort->waitForReadyRead(waite)) + { + return ""; + + } + if ( + m_pSerialPort->bytesAvailable() == 0 + ) + { + return ""; + } + + qbaRecv.clear(); + + qbaRecv = m_pSerialPort->readAll(); + + + std::string strRet(qbaRecv.constData(), qbaRecv.length()); + return strRet; + +// std::string strRet; +// char cBuf[MAXBUFFER]; +// int iRet = sio_read(m_piSettings.iPortNumber,cBuf, MAXBUFFER); +// if (iRet==0) +// { +// strRet = ""; +// +// } +// else +// { +// char *pRecv = new char[iRet]; +// memcpy(pRecv, cBuf, iRet); +// //std::string strRet(pRecv); +// //delete pRecv; +// //return strRet; +// +// strRet.resize(iRet); +// for (int i=0;iwrite(qbaTest); + m_pSerialPort->waitForBytesWritten(5000); + if (qi64Write != qbaTest.size()) + { + qDebug() << "Err:write Failed.Exit Code:1" << qi64Write; + return qi64Write; + } + + return 0; +// char* pcSend = (char*)strSend.c_str(); +// int iRet = sio_write(m_piSettings.iPortNumber, pcSend, (int)strSend.length()); +// +// //delete pcSend; +// if (iRet!= (int)strSend.length()) +// { +// return iRet; +// } +// else +// { +// return 0; +// } +// //sio_write(); +} diff --git a/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.h b/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.h new file mode 100644 index 0000000..5d7d0f4 --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/ZZ_SeiralPort.h @@ -0,0 +1,26 @@ +#pragma once +#include "VSMD12XMiscDefines.h" +#include "AbstractPort.h" +#include"qobject.h" +class CZZ_SeiralPort_QT :public CAbstractPort,QObject +{ + +private: + PortInfo m_piSettings; + QByteArray qbaSend, qbaRecv; + QSerialPort *m_pSerialPort; +public: + CZZ_SeiralPort_QT(); + virtual ~CZZ_SeiralPort_QT(); +public: + virtual void InitPort(PortInfo portinfo); + virtual bool SetPort(); + virtual bool Open(); + virtual void Close(); + + virtual std::string ReadAll(int waittime = 5000); + + virtual int Write(const std::string strSend); + +}; + diff --git a/othersoft/shuttercali/source/LinearShutter/pch.h b/othersoft/shuttercali/source/LinearShutter/pch.h new file mode 100644 index 0000000..d5ac3af --- /dev/null +++ b/othersoft/shuttercali/source/LinearShutter/pch.h @@ -0,0 +1,28 @@ +#pragma once +#include +////////////////////////////setings +#include +#include +////////////////////////////Basic +#include +#include +#include +#include +#include +////////////////////////////Thread +#include +#include +#include +////////////////////////////json +#include +#include +#include +#include +#include +////////////////////////////time +#include +#include +#include +////////////////////////////Serial I/O +#include +#include \ No newline at end of file diff --git a/othersoft/shuttercali/source/Logger/Logger.h b/othersoft/shuttercali/source/Logger/Logger.h new file mode 100644 index 0000000..cfbcf02 --- /dev/null +++ b/othersoft/shuttercali/source/Logger/Logger.h @@ -0,0 +1,90 @@ +// +// Created by xin on 2021/8/17. +//edit by zz. +//fixed code page problem;added a new initialize function; --20211101 +#pragma once + +#include +#include +#include +#include "qmutex.h" +#include "QtMsgHandler" + +namespace QT_LOG +{ + static int m_LogLevel = 1; + static QString m_LogFile = QString("%1.log").arg(QDateTime::currentDateTime().toString("yyyyMMddhhmmss")); + QMutex m_LogMutex; + + void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) + { + if (type < m_LogLevel) + { + return; + } + + QString log_info; + switch (type) + { + case QtDebugMsg: + log_info = QString("%1:%2").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"),msg); + break; + + case QtWarningMsg: + log_info = QString("%1[Warning]:%2").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"),msg); + break; + + case QtCriticalMsg: + log_info = QString("%1[Critical]:%2").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"),msg); + break; + + case QtFatalMsg: + log_info = QString("%1[Fatal]:%2").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"),msg); + abort(); + } + + m_LogMutex.lock(); + + QFile outFile(m_LogFile); + outFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text); + QTextStream ts(&outFile); + ts << log_info << endl; + outFile.close(); + + m_LogMutex.unlock(); + } + void logInit(QString logFile = "",int logLevel = 0) + { + +#ifndef DEBUG + if ((logLevel < 0) || (logLevel > 3)) + { + m_LogLevel = 1; + } + else + { + m_LogLevel = logLevel; + } + + if (!logFile.isEmpty()) + { + m_LogFile = logFile+"/"+m_LogFile; + } + + qInstallMessageHandler(customMessageHandler); + //qInstallMsgHandler(customMessageHandler); +#endif + } + + //added by IRIS_ZZ initialize from main + void ZZ_InitLogger(QString qstrDir) + { + QDir qdLogFolder; + qdLogFolder.mkdir(qstrDir); + qDebug() << QT_LOG::m_LogFile; + QT_LOG::logInit(qstrDir); + } +}; + + + diff --git a/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.dll b/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.dll new file mode 100644 index 0000000..66bc74c Binary files /dev/null and b/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.dll differ diff --git a/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.lib b/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.lib new file mode 100644 index 0000000..9f5efa5 Binary files /dev/null and b/othersoft/shuttercali/source/OSIF/DLib/SeaBreeze.lib differ diff --git a/othersoft/shuttercali/source/OSIF/include/api/DeviceFactory.h b/othersoft/shuttercali/source/OSIF/include/api/DeviceFactory.h new file mode 100644 index 0000000..12fae61 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/DeviceFactory.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file DeviceFactory.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * Notes: + * + * This class allows Device class instances to be created + * using just the name of the class as a string. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_DEVICE_FACTORY_H +#define SEABREEZE_DEVICE_FACTORY_H + +#include +#include +#include "common/devices/Device.h" + +namespace seabreeze { + + class DeviceFactory { + + public: + static DeviceFactory* getInstance(); + static DeviceFactory* instance; + static void shutdown(); + + Device *create(const std::string& name); + Device *create(int index); + int getNumberOfDeviceTypes(); + + private: + typedef Device *(*creatorFunction)(void); + DeviceFactory(); + std::map nameToCreator; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/DllDecl.h b/othersoft/shuttercali/source/OSIF/include/api/DllDecl.h new file mode 100644 index 0000000..d141060 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/DllDecl.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file DllDecl.h + * @date September 2012 + * @author Ocean Optics, Inc. + * + * This class provides the DLL import/export decorations + * required for Windows DLLs. It is encapsulated to + * reduce copy-paste and to allow a single point of + * maintenance. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_DLL_DECL_H +#define SEABREEZE_DLL_DECL_H + +#ifdef _WINDOWS + #ifdef BUILD_DLL + #define DLL_DECL __declspec(dllexport) + #else + #define DLL_DECL __declspec(dllimport) + #endif + + // "STL member 'seabreeze::api::Foo::foo' needs to have dll-interface + // to be used by clients of class 'seabreeze::api::Foo'" + #pragma warning (disable: 4251) + + // "non dll-interface class 'seabreeze::Foo' used as base for dll-interface + // class 'seabreeze::api::Bar'" + #pragma warning (disable: 4275) +#else + #define DLL_DECL +#endif + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/SeaBreezeWrapper.h b/othersoft/shuttercali/source/OSIF/include/api/SeaBreezeWrapper.h new file mode 100644 index 0000000..da6b94c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/SeaBreezeWrapper.h @@ -0,0 +1,864 @@ +/***************************************************//** + * @file SeaBreezeWrapper.h + * @date July 2009 + * @author Ocean Optics, Inc. + * + * This is a trivial interface to SeaBreeze that allows + * the user to connect to devices over USB. + * This is intended as a usable and extensible API. + * + * This provides a C interface to help with linkage. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_WRAPPER_H +#define SEABREEZE_WRAPPER_H + +#define SEABREEZE_API_VERSION "3.0.11" //!< current version of the SeaBreezeWrapper API +#define SEABREEZE_MAX_DEVICES 32 //!< how many different spectrometer types we support + +#include "api/DllDecl.h" + +#ifdef __cplusplus + +/** +* @brief Encapsulates all SeaBreeze classes +*/ +namespace seabreeze { + class Device; +} + +/** + Original interface to SeaBreeze. SeaBreezeAPI represents a proposed architecture for + future development. +*/ +class DLL_DECL SeaBreezeWrapper { +public: + + //! get handle to Singleton + static SeaBreezeWrapper *getInstance(); + + //! free some static memory under Microsoft profiler + static void shutdown(); + + // lifecycle + int openSpectrometer (int index, int *errorCode); + int closeSpectrometer (int index, int *errorCode); + + // metadata + int getModel (int index, int *errorCode, char *buf, int len); + int getSerialNumber (int index, int *errorCode, char *buf, int len); + + // basic acquisitions + void setIntegrationTimeMicrosec(int index, int *errorCode, unsigned long integration_time_micros); + int getWavelengths (int index, int *errorCode, double *wavelengths, int length); + int getFormattedSpectrum (int index, int *errorCode, double* buffer, int buffer_length); + int getUnformattedSpectrum (int index, int *errorCode, unsigned char *buffer, int buffer_length); + int getFormattedSpectrumLength(int index, int *errorCode); + int getUnformattedSpectrumLength(int index, int *errorCode); + long getMinIntegrationTimeMicrosec(int index, int *errorCode); + long getMaxIntegrationTimeMicrosec(int index, int *errorCode); + int getMaximumIntensity(int index, int *errorCode); + + // advanced features + int getElectricDarkPixelIndices(int index, int *errorCode, int *indices, int length); + void setTriggerMode (int index, int *errorCode, int mode); + void setStrobeEnable (int index, int *errorCode, unsigned char strobe_enable); + void setShutterOpen (int index, int *errorCode, unsigned char opened); + void setContinuousStrobePeriodMicrosec(int index, int *errorCode, unsigned short strobe_id, unsigned long period_usec); + void setAcquisitionDelayMicrosec(int index, int *errorCode, unsigned long delay_usec); + + // Buffering features + void clearBuffer (int index, int *errorCode); + unsigned long getBufferElementCount(int index, int *errorCode); + unsigned long getBufferCapacity (int index, int *errorCode); + unsigned long getBufferCapacityMaximum(int index, int *errorCode); + unsigned long getBufferCapacityMinimum(int index, int *errorCode); + void setBufferCapacity (int index, int *errorCode, unsigned long capacity); + + // EEPROM access + int readEEPROMSlot (int index, int *errorCode, int slot_number, unsigned char *buffer, int buffer_length); + int writeEEPROMSlot (int index, int *errorCode, int slot_number, unsigned char *buffer, int buffer_length); + + // irradiance calibration + int readIrradCalibration (int index, int *errorCode, float *buffer, int buffer_length); + int writeIrradCalibration (int index, int *errorCode, float *buffer, int buffer_length); + int hasIrradCollectionArea (int index, int *errorCode); + float readIrradCollectionArea (int index, int *errorCode); + void writeIrradCollectionArea (int index, int *errorCode, float area); + + // thermal-electric cooler + double readTECTemperature (int index, int *errorCode); + void setTECTemperature (int index, int *errorCode, double temperature_degrees_celsius); + void setTECEnable (int index, int *errorCode, unsigned char tec_enable); + void setTECFanEnable (int index, int *errorCode, unsigned char tec_fan_enable); + + // Wrapper features + void setVerbose (bool flag); + void setLogfile (char *path, int length); + int getAPIVersionString (char *buffer, int length); + int getErrorString (int errorCode, char *buffer, int buffer_length); + + // raw USB access + int writeUSB (int index, int *errorCode, unsigned char endpoint, unsigned char *buffer, unsigned int length); + int readUSB (int index, int *errorCode, unsigned char endpoint, unsigned char *buffer, unsigned int length); + int getUSBDescriptorString (int index, int *errorCode, int id, unsigned char *buffer, int length); + + // light sources (JAZ?) + int getLightSourceCount (int index, int *errorCode); + void setLightSourceEnable (int index, int *errorCode, int lightIndex, unsigned char enable); + void setLightSourceIntensity (int index, int *errorCode, int lightIndex, double intensity); + +private: + SeaBreezeWrapper(); + virtual ~SeaBreezeWrapper(); + + //! Singleton + static SeaBreezeWrapper *instance; + + //! types of supported Ocean Optics devices (not actual devices found enumerated on the USB bus) + seabreeze::Device *devices[SEABREEZE_MAX_DEVICES]; +}; + +extern "C" { +#endif /* __cplusplus */ + + /* All of these C functions start with seabreeze_ to prevent namespace + * collisions. + */ + + /** + * @brief This function opens a device attached to the system. + * @param index (Input) The index of a USB device to try to open. + * Valid values will range from 0 to N-1 for N connected devices. + * @param error_code (Output) A pointer to an integer that can be used + * for storing error codes. + * @return int: The function will return an integer of 0 if it opened a + * device successfully, or 1 if no device was opened (in which + * case the error_code variable will be set). + * + * This can be called repeatedly with incrementing index values (until + * it returns 1) to open all connected devices. + * + * Note that the index used to open a device with this function should also + * be used to communicate with that same device in the other functions + * provided here. + */ + DLL_DECL int + seabreeze_open_spectrometer(int index, int *error_code); + + /** + * @brief This function closes the spectrometer attached to the system. + * @param index (Input) The index of a device previously opened with + * open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used + * for storing error codes. + * @return int: This function will return 1 no matter what! (MZ) + */ + DLL_DECL int + seabreeze_close_spectrometer(int index, int *error_code); + + /** + * @brief This function returns a description of the error denoted by + * error_code. + * @param error_code (Input) The integer error code to look up. Error + * codes not be zero, but can be any non-zero integer (positive or + * negative). + * @param buffer (Output) A character buffer allocated to contain at least + * 'buffer_length' bytes, which will be populated with the string + * description of the given error code. + * @param buffer_length (Input) allocated size of the output buffer + * @return int: Number of bytes written to buffer. + */ + DLL_DECL int + seabreeze_get_error_string(int error_code, char *buffer, int buffer_length); + + /** + * @brief This function returns a string denoting the type of the device. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. This may be NULL. + * @param buffer (Output) A character buffer allocated to contain at least + * 'buffer_length' bytes, which will be populated with the + * spectrometer type. + * @param buffer_length (Input) allocated size of the buffer + * @return int: Number of bytes written to the buffer. + * + * The populated buffer will hold one of the following strings: + * + * \verbatim + * NONE: Used if no spectrometer is found (error_code will also be set) + * HR2000: Represents an HR2000 Spectrometer + * HR2000PLUS: Represents an HR2000+ Spectrometer + * HR4000: Represents an HR4000 Spectrometer + * JAZ: Represents a Jaz Spectrometer + * MAYA2000: Represents a Maya2000 Spectrometer + * MAYALSL: Represents a Maya-LSL Spectrometer + * MAYA2000PRO: Represents a Maya2000 Pro Spectrometer + * NIRQUEST256: Represents an NIRQuest256 Spectrometer + * NIRQUEST512: Represents an NIRQuest512 Spectrometer + * QE65000: Represents a QE65000 Spectrometer + * QE-PRO: Represents a QE-Pro Spectrometer + * STS: Represents an STS Spectrometer + * TORUS: Represents a Torus Spectrometer + * USB2000: Represents a USB2000 Spectrometer + * USB2000PLUS: Represents a USB2000+ Spectrometer + * USB4000: Represents a USB4000 Spectrometer + * \endverbatim + */ + DLL_DECL int + seabreeze_get_model(int index, int *error_code, char *buffer, int buffer_length); + + /** + * @brief This function sets the trigger mode for the specified device. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param mode (Input) a trigger mode (0 = normal, 1 = software, 2 = synchronization, + * 3 = external hardware, etc.) + * + * Note that requesting an unsupported mode will result in an error. + */ + + DLL_DECL void + seabreeze_set_trigger_mode(int index, int *error_code, int mode); + + /** + * @brief This function sets the integration time for the specified device. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param integration_time_micros (Input) The new integration time in units of + * microseconds + * + * This function does not automatically perform a stability scan. + * If your application requires a stability scan following a change + * in integration time, you need to command that yourself. + */ + DLL_DECL void + seabreeze_set_integration_time_microsec(int index, int *error_code, + unsigned long integration_time_micros); + + /** + * @brief This function returns the smallest integration time setting, + * in microseconds, that is valid for the spectrometer. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return Returns minimum legal integration time in microseconds if > 0. + * On error, returns -1 and error_code will be set accordingly. + */ + DLL_DECL long + seabreeze_get_min_integration_time_microsec(int index, int *error_code); + + /** + * @brief This function sets the shutter state on the spectrometer. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param opened (Input) A logical boolean used for denoting the desired + * state (opened/closed) of the shutter. If the value of opened is + * non-zero, then the shutter will open. If the value of opened is + * zero, then the shutter will close. + */ + DLL_DECL void + seabreeze_set_shutter_open(int index, int *error_code, unsigned char opened); + + /** + * @brief This function sets the strobe enable on the spectrometer. Note that + * this refers to a particular set of one or more digital pins on the + * device: lamp enable, single strobe, and continuous strobe may all + * be affected by this setting, and these generally control lamps + * that are external to the device. Note that this is related to, but + * different from, the light source interface which allows the intensity + * and/or enable status of individual light sources (e.g. lamp bulbs, + * LEDs, or lasers) in attached modules to be controlled. Refer to + * the seabreeze_xxx_light_source_ functions for finer control of + * certain light source modules that are more closely integrated with + * the spectrometer. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param strobe_enable (Input) A logical boolean used for denoting the + * desired value (high/low) of the strobe-enable pin. If the value of + * strobe_enable is zero, then the pin should be set low. If the value + * of strobe_enable is non-zero, then the pin should be set high. + */ + DLL_DECL void + seabreeze_set_strobe_enable(int index, int *error_code, unsigned char strobe_enable); + + /** + * @brief This function gets the number of attached light sources that can + * be programmatically controlled. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The number of light sources that can be controlled + */ + DLL_DECL int + seabreeze_get_light_source_count(int index, int *error_code); + + /** + * @brief This function sets the enable status on a connected light source. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_index (Input) The index of the light source. This will + * usually be zero, but if the light module contains multiple LEDs, + * bulbs, lasers, etc. then this may be higher. Use + * seabreeze_get_light_source_count() to bound the maximum value . + * @param enable (Input) A logical boolean used for denoting whether to enable + * the indicated light source. If the value of + * enable is zero, then the light source should be disabled. If the value + * of enable is non-zero, then the light source should be enabled. + */ + DLL_DECL void + seabreeze_set_light_source_enable(int index, int *error_code, + int light_index, unsigned char enable); + + /** + * @brief This function sets the intensity of a connected light source. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_index (Input) The index of the light source. This will + * usually be zero, but if the light module contains multiple LEDs, + * bulbs, lasers, etc. then this may be higher. Use + * seabreeze_get_light_source_count() to bound the maximum value. + * @param intensity (Input) The desired intensity of the light source. The + * range of intensities is normalized over [0, 1], where 0 is the + * minimum controllable intensity of the light source, and 1 is the + * maximum. + * + * @warning SETTING THE INTENSITY TO ZERO MAY NOT CAUSE THE LIGHT SOURCE + * TO TURN OFF COMPLETELY. The light source will go to the + * dimmest level it can reach without changing its enable status. + * To switch the light source off, try using the + * seabreeze_set_light_source_enable() function or provide the + * operator with another way to disable or block the light source. + */ + DLL_DECL void + seabreeze_set_light_source_intensity(int index, int *error_code, + int light_index, double intensity); + + /** + * @brief This function reads a string out of the spectrometer's EEPROM slot + * and returns the result. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param slot_number (Input) The number of the slot to read out. Possible + * values are 0 through 16*. + * @param buffer (Output) A buffer (with memory already allocated) to hold the + * value read out of the EEPROM slot + * @param buffer_length (Input) The length of the allocated output buffer (typically 16) + * @return int: The number of bytes read from the EEPROM slot into the buffer + * + * (*) Actual maximum slot count varies by spectrometer model. For the number of supported + * slots on your spectrometer, see EEPROMSlotFeature instantiation in appropriate + * device file under src/vendors/OceanOptics/devices. + */ + DLL_DECL int + seabreeze_read_eeprom_slot(int index, int *error_code, int slot_number, unsigned char *buffer, + int buffer_length); + + /** + * @brief This function writes a string to a spectrometer's EEPROM slot + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer for storing error codes. + * @param slot_number (Input) The number of the slot being written (e.g. 0-16*). + * @param buffer (Input) A buffer containing the text to write to the slot. + * @param buffer_length (Input) The length of the text to write (typically 15) + * @return number of bytes written + * + * @warning CARELESS USE OF THIS FUNCTION CAN RENDER YOUR SPECTROMETER INOPERABLE, + * POSSIBLY REQUIRING R.M.A. OR REFLASHING TO RESTORE FUNCTIONALITY. + * PLEASE READ YOUR SPECTROMETER'S DATA SHEET CAREFULLY BEFORE USE. + * + * (*) See note in seabreeze_read_eeprom_slot() regarding per-device slot limits. + */ + DLL_DECL int + seabreeze_write_eeprom_slot(int index, int *error_code, int slot_number, unsigned char *buffer, + int buffer_length); + + /** + * @brief This function reads out an irradiance calibration from the spectrometer's + * internal memory if that feature is supported. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) array of floating point values into which calibration values are stored + * @param buffer_length (Input) maximum number of values to copy from the device into buffer + * @return int: the number of floats read from the device into the buffer + */ + DLL_DECL int + seabreeze_read_irrad_calibration(int index, int *error_code, float *buffer, + int buffer_length); + + /** + * @brief This function writes an irradiance calibration to the spectrometer's + * internal memory if that feature is supported. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) array of floating point values to store into the device + * @param buffer_length (Input) number of calibration factors to write + * @return int: the number of floats written from the buffer to the device + */ + DLL_DECL int + seabreeze_write_irrad_calibration(int index, int *error_code, float *buffer, + int buffer_length); + + /** + * @brief This function checks for an irradiance collection area in the spectrometer's + * internal memory if that feature is supported. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return int: 0 if no collection area available, 1 if available. + */ + DLL_DECL int + seabreeze_has_irrad_collection_area(int index, int *error_code); + + /** + * @brief This function reads an irradiance collection area from the spectrometer's + * internal memory if that feature is supported. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return float: collection area (typically in units of cm^2) read from device + */ + DLL_DECL float + seabreeze_read_irrad_collection_area(int index, int *error_code); + + /** + * @brief This function writes an irradiance collection area to the spectrometer's + * internal memory if that feature is supported. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param area (Input) collection area to save to the EEPROM (presumably cm^2) + */ + DLL_DECL void + seabreeze_write_irrad_collection_area(int index, int *error_code, float area); + + /** + * @brief This function reads the value of the TEC and returns the value in + * degrees celsius. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return int: The TEC temperature in degrees Celsius. + */ + DLL_DECL double + seabreeze_read_tec_temperature(int index, int *error_code); + + /** + * @brief This function sets the TEC temperature. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param temperature_degrees_celsius (Input) The desired temperature, in degrees + * Celsius. + */ + DLL_DECL void + seabreeze_set_tec_temperature(int index, int *error_code, + double temperature_degrees_celsius); + + /** + * @brief This function enables the TEC feature on the spectrometer. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param tec_enable (Input) A logical boolean that denotes the desired TEC enable + * state. If the value of tec_enable is zero, the TEC should be disabled. + * If the value of tec_enable is non-zero, the TEC should be enabled. + */ + DLL_DECL void + seabreeze_set_tec_enable(int index, int *error_code, unsigned char tec_enable); + + /** + * @brief This function enables the TEC Fan on the spectrometer. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param tec_fan_enable (Input) A logical boolean that denotes the desired TEC fan enable + * state. If the value of tec_fan_enable is zero, the TEC fan should be disabled. + * If the value of tec_fan_enable is non-zero, the TEC fan should be enabled. + */ + DLL_DECL void + seabreeze_set_tec_fan_enable(int index, int *error_code, unsigned char tec_fan_enable); + + /** + * @brief This acquires a spectrum and returns the answer in raw, unformatted bytes. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) A buffer (with memory already allocated) to hold the + * spectral data + * @param buffer_length (Input) The length of the buffer in bytes (not pixels) + * @return int: The number of bytes read into the buffer + * @see sample-code/c/demo-unformatted-spectrum.c + * + * An unformatted spectrum is the raw sequence of bytes returned by the spectrometer to + * the PC over USB. The bytes have not been broken down into pixels, they're in the + * original endianness, absolutely nothing has been done to them. The caller is expected + * to know how many bytes are returned by each spectrometer model, which bytes indicate + * synchronization points or whatever, etc. + */ + DLL_DECL int + seabreeze_get_unformatted_spectrum(int index, int *error_code, + unsigned char *buffer, int buffer_length); + + /** + * @brief This acquires a spectrum and returns the answer in formatted + * floats. In this mode, auto-nulling should be automatically + * performed for devices that support it. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) A buffer (with memory already allocated) to hold the + * spectral data + * @param buffer_length (Input) The length of the buffer in floats (not bytes) + * @return int: The number of floats read into the buffer + * + * A formatted spectrum returns exactly one double-precision floating-point IEEE value + * per pixel, as opposed to a raw byte stream. It has also had autonulling (gain control) + * applied, meaning it has been scaled up to the spectrometer's full dynamic range using + * the gain setting recorded in that spectrometer’s EEPROM. + */ + DLL_DECL int + seabreeze_get_formatted_spectrum(int index, int *error_code, + double* buffer, int buffer_length); + + /** + * @brief This returns an integer denoting the length of a raw spectrum + * (as returned by get_unformatted_spectrum(...)). + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return int: An integer denoting the length of an unformatted spectrum in bytes + * + * The caller is expected to know the number of bytes per pixel and the endian + * ordering, but it will normally be 2 bytes per pixel, LSB-MSB order. + */ + DLL_DECL int + seabreeze_get_unformatted_spectrum_length(int index, int *error_code); + + /** + * @brief This returns an integer denoting the number of pixels in a + * formatted spectrum (as returned by get_formatted_spectrum(...)). + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return int: An integer denoting the length of a formatted spectrum (in pixels) + */ + DLL_DECL int + seabreeze_get_formatted_spectrum_length(int index, int *error_code); + + /** + * @brief This computes the wavelengths for the spectrometer and fills in the + * provided array (up to the given length) with those values. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param wavelengths (Output) A pre-allocated array of doubles into which the + * wavelengths will be copied + * @param length (Input) The number of values to copy into the wavelength array (this should + * be no larger than the number of doubles allocated in the wavelengths + * array) + * @return int: An integer denoting the number of wavelengths written to the buffer + */ + DLL_DECL int + seabreeze_get_wavelengths(int index, int *error_code, double *wavelengths, int length); + + /** + * @brief This reads the device's serial number and fills the + * provided array (up to the given length) with it. + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) A pre-allocated array of characters into which the serial number + * will be copied + * @param buffer_length (Input) The number of values to copy into the buffer (this should + * be no larger than the number of chars allocated in the buffer) (typically 16) + * @return int: An integer denoting the number of bytes written into the buffer + * + * Note that "serial numbers" may include both digits and letters + */ + DLL_DECL int + seabreeze_get_serial_number(int index, int *error_code, char *buffer, int buffer_length); + + /** + * @brief This fills in the provided array (up to the given length) with the indices + * of the pixels that are electrically active but optically masked + * (a.k.a. electric dark pixels). + * @param index (Input) The index of a device previously opened with open_spectrometer(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param indices (Output) A pre-allocated array of ints into which the pixel indices + * will be copied + * @param length (Input) The number of values to copy into the indices array (this should + * be no larger than the number of ints allocated in the indices array) + * @return int: An integer denoting the number of indices written into the indices buffer + * + * Note that not all detectors have optically masked pixels; in that case, + * this function will return zero. + */ + DLL_DECL int + seabreeze_get_electric_dark_pixel_indices(int index, int *error_code, + int *indices, int length); + + /** + * @brief Shutdown SeaBreeze completely, releasing all resources and destroying + * any cached device handles. + * + * This function is not normally needed (Singletons are destroyed automatically + * at process end), but calling this explicitly can resolve some spurious warnings + * in highly paranoid memory leak profilers. + */ + DLL_DECL void + seabreeze_shutdown(); + + /** + * @brief Write a raw array of bytes to a USB spectrometer. + * @param index (Input) index of an opened spectrometer + * @param errorCode (Output) pointer to an allocated integer field for receiving error codes + * @param endpoint (Input) USB endpoint for write operation + * (see src/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeature.cpp) + * @param buffer (Input) array of bytes to send to USB spectrometer + * @param length (Input) number of bytes to write from buffer to spectrometer + * @return number of bytes written + * + * Write the bytes in the buffer according to the two command bytes at the + * start of the buffer. + * + * \section Endpoints + * + * You may wonder why the caller needs to specify an explicit endpoint for + * raw read and write operations; does not SeaBreeze already know the appro- + * priate endpoints for any open spectrometer, for example. Yes it does, + * but currently there is no easy way to extract endpoints from a generic + * spectrometer, due to the fact that OOIUSBCypressEndpointMap and + * OOIUSBSTSEndpointMap do not share a common base class (see + * OOIUSBEndpointMaps.h). + * + * We could attempt to extract them from the TransferHelpers held by + * OOIUSBInterface, but without a Hint to use as a key, we would likely + * obtain unmatched or inappropriate versions for control exchanges. + * As ControlHint and OBPControlHint share no common ancestor or type data + * to associate them while distinguishing from other hint types, we cannot + * automatically infer appropriate control endpoints. + * + * And finally, we have no way of knowing that the user really wants to + * use control endpoints anyway: they may actually desire high-speed + * spectral retrieval. So really, this needs to remain a manual external + * operation until such time as we provide a much richer, generic query + * interface over our internal endpoint lookup tables. + * + * \section Example + * + * For instance, for most USB spectrometers, the hex values 05 00 in + * the buffer means 'read EEPROM slot 0'. Writing this command, and following + * it with the \c seabreeze_read_usb command and the same hex 05 00 + * in the buffer, will result in the spectrometer's serial number, in ASCII + * characters, being delivered to the subsequent bytes in the buffer array. + * This would appear in the output buffer as: + * + * \code + * 05 00 55 53 42 32 2B 48 30 31 34 31 36 00 00 00 00 (hex) + * \endcode + * + * (USB2+H01416 ASCII, skipping the two command bytes) + * + * A C or C++ program could use the data as-is, but a C# program could + * append to a string, each byte, cast as char, stopping on the first null + * character: + * + * \code + * string serial = ""; + * for (int i = 0; i < length && buffer[i] != '\0'; i++) + * serial += (char)buffer[i]; + * \endcode + * + * This is equivalent to: + * + * \code + * string serial = System.Text.ASCIIEncoding.ASCII.GetString(buffer).Trim('\0'); + * \endcode + * + * For C# and VB.NET, the trailing zero-fill must be removed. Those null + * characters would not print or display on a screen but would make a file + * name invalid. + */ + DLL_DECL int + seabreeze_write_usb(int index, int *errorCode, unsigned char endpoint, unsigned char* buffer, unsigned int length); + + /** + * @brief Read a raw array of bytes from a USB spectrometer. + * @param index (Input) index of a previously opened spectrometer + * @param errorCode (Output) pointer to an allocated integer field for receiving error codes + * @param endpoint (Input) USB endpoint for read operation + * (see src/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeature.cpp) + * @param buffer (Input) array of allocated bytes at which to recieve USB data + * @param length (Input) maximum number of bytes to read from spectrometer + * @return number of received bytes written to buffer + * + * Read bytes from the spectrometer into the buffer. The buffer starts with + * two bytes of command information that will be followed by the transferred + * bytes. The read and write USB functions allow low-level control of the + * spectrometer via USB commands. The higher-level SeaBreeze functions issue + * USB commands internally. + * + * Reading USB data takes two steps. First a seabreeze_write_usb call requests + * the transfer, then a seabreeze_read_usb call delivers the data. Writing a buffer + * to USB takes one step. The operating system handle for the spectrometer is + * managed by SeaBreeze. USB has a concept of "end points". These are implicitly + * addressed by the seabreeze_read_usb and seabreeze_write_usb functions. + */ + DLL_DECL int + seabreeze_read_usb(int index, int *errorCode, unsigned char endpoint, unsigned char* buffer, unsigned int length); + + /** + * @brief Get the SeaBreeze library's internal version identifier. + * @param buffer (Output) pointer to an allocated character array + * to hold the returned version string + * @param len (Input) size of the allocated buffer + * @return number of bytes written to buffer + */ + DLL_DECL int + seabreeze_get_api_version_string(char *buffer, int len); + + /** + * @brief Get a USB descriptor string by number + * @param index (Input) Which spectrometer to set + * @param errorCode (Output) pointer to allocated integer to receive error code + * @param id (Input) numeric ID of the desired USB descriptor string + * @param buffer (Output) pointer to an allocated character array to hold + * the returned descriptor string + * @param len (Input) size of the allocated buffer + * @return number of bytes written to buffer + */ + DLL_DECL int + seabreeze_get_usb_descriptor_string(int index, int *errorCode, int id, unsigned char *buffer, int len); + + /** + * @brief Set the continuous strobe period in microseconds + * @param index (Input) Which spectrometer to set + * @param errorCode (Output) pointer to allocated integer to receive error code + * @param strobe_id (Input) index of the strobe generator (currently always zero) + * @param period_usec (Input) total period of the strobe, in microseconds + * @return zero (on success or failure; check errorCode) + * + * The resolution is 0.1 milliseconds (100 microseconds). + */ + DLL_DECL void + seabreeze_set_continuous_strobe_period_microsec(int index, int *errorCode, + unsigned short strobe_id, unsigned long period_usec); + + /** + * @brief Set the acquisition delay (trigger delay) in microseconds. This + * controls the amount of time between a particular event + * (usually a request for spectrum or an external trigger pulse) + * and the start of acquisition. + */ + DLL_DECL void + seabreeze_set_acquisition_delay_microsec(int index, + int *errorCode, unsigned long delay_usec); + + /** + * @brief Clear the spectrum buffer (if equipped) + * @param index (Input) Which spectrometer should have its buffer cleared + * @param error_code (Output) Pointer to allocated integer to receive error code + */ + DLL_DECL void + seabreeze_clear_buffer(int index, int *error_code); + + /** + * @brief Get the number of spectra presently in the buffer (if equipped) + * @param index (Input) Which spectrometer should have its buffer queried + * @param error_code (Output) Pointer to allocated integer to receive error code + * @return Number of spectra in the buffer + */ + DLL_DECL unsigned long + seabreeze_get_buffer_element_count(int index, int *error_code); + + /** + * @brief Get the currently configured size of the data buffer (if equipped) + * @param index (Input) Which spectrometer should have its buffer queried + * @param error_code (Output) Pointer to allocated integer to receive error code + * @return The present limit on the number of spectra that will be retained. + */ + DLL_DECL unsigned long + seabreeze_get_buffer_capacity(int index, int *error_code); + + /** + * @brief Get the maximum possible configurable size for the data buffer (if equipped) + * @param index (Input) Which spectrometer should have its buffer queried + * @param error_code (Output) Pointer to allocated integer to receive error code + * @return Maximum allowed value for the buffer size + */ + DLL_DECL unsigned long + seabreeze_get_buffer_capacity_maximum(int index, int *error_code); + + /** + * @brief Get the minimum possible configurable size for the data buffer (if equipped) + * @param index (Input) Which spectrometer should have its buffer queried + * @param error_code (Output) Pointer to allocated integer to receive error code + * @return Minimum allowed value for the buffer size + */ + DLL_DECL unsigned long + seabreeze_get_buffer_capacity_minimum(int index, int *error_code); + + /** + * @brief Set the number of spectra that the buffer should keep + * @param index (Input) Which spectrometer should have its buffer modified + * @param error_code (Output) Pointer to allocated integer to receive error code + * @param capacity (Input) Limit on number of spectra to store. + * Note that this must be within the range defined by the capacity minimum + * and maximum values. + */ + DLL_DECL void + seabreeze_set_buffer_capacity(int index, int *error_code, unsigned long capacity); + + /** + * @brief Programmatically enable debug outputs to stderr + * @param flag (Input) zero to disable (default), non-zero to enable + */ + DLL_DECL void + seabreeze_set_verbose(int flag); + + /** + * @brief redirect verbose logging to named file + * @param flag (Input) NULL for default behavior (stderr), non-null for valid OS path + */ + DLL_DECL void + seabreeze_set_logfile(char* pathname, int len); + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* SEABREEZE_WRAPPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/AcquisitionDelayFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/AcquisitionDelayFeatureAdapter.h new file mode 100644 index 0000000..4964256 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/AcquisitionDelayFeatureAdapter.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file AcquisitionDelayFeatureAdapter.h + * @date November 2015 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows access to SeaBreeze + * DataBufferFeatureInterface instances. + * + * 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_ADAPTER_H +#define SEABREEZE_ACQUISITION_DELAY_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class AcquisitionDelayFeatureAdapter + : public FeatureAdapterTemplate { + public: + AcquisitionDelayFeatureAdapter(AcquisitionDelayFeatureInterface *intf, + const FeatureFamily &f, Protocol *p, Bus *b, + unsigned short instanceIndex); + + virtual ~AcquisitionDelayFeatureAdapter(); + + /* Acquisition delay functions */ + unsigned long getAcquisitionDelayIncrementMicroseconds(int *errorCode); + unsigned long getAcquisitionDelayMaximumMicroseconds(int *errorCode); + unsigned long getAcquisitionDelayMinimumMicroseconds(int *errorCode); + unsigned long getAcquisitionDelayMicroseconds(int *errorCode); + void setAcquisitionDelayMicroseconds(int *errorCode, const unsigned long delay_usec); + }; + + } /* end namespace api */ +} /* end namespace seabreeze */ + +#endif /* SEABREEZE_ACQUISITION_DELAY_FEATURE_ADAPTER_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ContinuousStrobeFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ContinuousStrobeFeatureAdapter.h new file mode 100644 index 0000000..23a106a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ContinuousStrobeFeatureAdapter.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file ContinuousStrobeFeatureAdapter.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows access to SeaBreeze + * ContinuousStrobeFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTINUOUS_STROBE_FEATURE_ADAPTER_H +#define SEABREEZE_CONTINUOUS_STROBE_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class ContinuousStrobeFeatureAdapter + : public FeatureAdapterTemplate { + public: + ContinuousStrobeFeatureAdapter(ContinuousStrobeFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~ContinuousStrobeFeatureAdapter(); + + void setContinuousStrobePeriodMicroseconds(int *errorCode, unsigned long period_usec); + void setContinuousStrobeEnable(int *errorCode, bool enable); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DataBufferFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DataBufferFeatureAdapter.h new file mode 100644 index 0000000..af1d536 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DataBufferFeatureAdapter.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file DataBufferFeatureAdapter.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows access to SeaBreeze + * DataBufferFeatureInterface instances. + * + * 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_DATA_BUFFER_FEATURE_ADAPTER_H +#define SEABREEZE_DATA_BUFFER_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/data_buffer/DataBufferFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class DataBufferFeatureAdapter + : public FeatureAdapterTemplate { + public: + DataBufferFeatureAdapter(DataBufferFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~DataBufferFeatureAdapter(); + + /* Data buffer functions */ + void clearBuffer(int *errorCode); + unsigned long getNumberOfElements(int *errorCode); + unsigned long getBufferCapacity(int *errorCode); + unsigned long getBufferCapacityMaximum(int *errorCode); + unsigned long getBufferCapacityMinimum(int *errorCode); + void setBufferCapacity(int *errorCode, unsigned long capacity); + }; + + } /* end namespace api */ +} /* end namespace seabreeze */ + +#endif /* SEABREEZE_DATA_BUFFER_FEATURE_ADAPTER_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DeviceAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DeviceAdapter.h new file mode 100644 index 0000000..7931024 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/DeviceAdapter.h @@ -0,0 +1,308 @@ +/***************************************************//** + * @file DeviceAdapter.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a wrapper that allows + * access to SeaBreeze Device instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 DEVICEADAPTER_H +#define DEVICEADAPTER_H + +/* Includes */ +#include "common/devices/Device.h" +#include "common/buses/DeviceLocatorInterface.h" +#include "api/seabreezeapi/EEPROMFeatureAdapter.h" +#include "api/seabreezeapi/IrradCalFeatureAdapter.h" +#include "api/seabreezeapi/RawUSBBusAccessFeatureAdapter.h" +#include "api/seabreezeapi/NonlinearityCoeffsFeatureAdapter.h" +#include "api/seabreezeapi/TemperatureFeatureAdapter.h" +#include "api/seabreezeapi/RevisionFeatureAdapter.h" +#include "api/seabreezeapi/OpticalBenchFeatureAdapter.h" +#include "api/seabreezeapi/SpectrumProcessingFeatureAdapter.h" +#include "api/seabreezeapi/SerialNumberFeatureAdapter.h" +#include "api/seabreezeapi/ShutterFeatureAdapter.h" +#include "api/seabreezeapi/SpectrometerFeatureAdapter.h" +#include "api/seabreezeapi/StrayLightCoeffsFeatureAdapter.h" +#include "api/seabreezeapi/StrobeLampFeatureAdapter.h" +#include "api/seabreezeapi/ContinuousStrobeFeatureAdapter.h" +#include "api/seabreezeapi/ThermoElectricCoolerFeatureAdapter.h" +#include "api/seabreezeapi/LightSourceFeatureAdapter.h" +#include "api/seabreezeapi/PixelBinningFeatureAdapter.h" +#include "api/seabreezeapi/DataBufferFeatureAdapter.h" +#include "api/seabreezeapi/AcquisitionDelayFeatureAdapter.h" +#include + +namespace seabreeze { + namespace api { + + class DeviceAdapter { + public: + DeviceAdapter(Device *dev, unsigned long id); + ~DeviceAdapter(); + + int open(int *errorCode); + void close(); + + DeviceLocatorInterface *getLocation(); + + /* An for weak association to this object */ + unsigned long getID(); + + /* Get a string that describes the type of device */ + int getDeviceType(int *errorCode, char *buffer, unsigned int maxLength); + + /* Get a usb endpoint for the device according to the enumerator */ + /* endpointType. A 0 is returned if the endpoint requested is not in use. */ + unsigned char getDeviceEndpoint(int *errorCode, usbEndpointType anEndpointType); + + /* Get one or more raw USB access features */ + int getNumberOfRawUSBBusAccessFeatures(); + int getRawUSBBusAccessFeatures(long *buffer, int maxFeatures); + int rawUSBBusAccessRead(long featureID, + int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint); + int rawUSBBusAccessWrite(long featureID, + int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint); + + /* Get one or more serial number features */ + int getNumberOfSerialNumberFeatures(); + int getSerialNumberFeatures(long *buffer, int maxFeatures); + int getSerialNumber(long featureID, int *errorCode, + char *buffer, int bufferLength); + unsigned char getSerialNumberMaximumLength(long featureID, int *errorCode); + + /* Get one or more spectrometer acquisition features */ + int getNumberOfSpectrometerFeatures(); + int getSpectrometerFeatures(long *buffer, int maxFeatures); + void spectrometerSetTriggerMode(long spectrometerFeatureID, int *errorCode, int mode); + void spectrometerSetIntegrationTimeMicros(long spectrometerFeatureID, int *errorCode, + unsigned long integrationTimeMicros); + unsigned long spectrometerGetMinimumIntegrationTimeMicros( + long spectrometerFeatureID, int *errorCode); + unsigned long spectrometerGetMaximumIntegrationTimeMicros( + long spectrometerFeatureID, int *errorCode); + double spectrometerGetMaximumIntensity( + long spectrometerFeatureID, int *errorCode); + int spectrometerGetUnformattedSpectrumLength( + long spectrometerFeatureID, int *errorCode); + int spectrometerGetUnformattedSpectrum(long spectrometerFeatureID, + int *errorCode, unsigned char *buffer, int bufferLength); + int spectrometerGetFormattedSpectrumLength( + long spectrometerFeatureID, int *errorCode); + int spectrometerGetFormattedSpectrum(long spectrometerFeatureID, int *errorCode, + double *buffer, int bufferLength); + int spectrometerGetWavelengths(long spectrometerFeatureID, int *errorCode, + double *wavelengths, int length); + int spectrometerGetElectricDarkPixelCount( + long spectrometerFeatureID, int *errorCode); + int spectrometerGetElectricDarkPixelIndices( + long spectrometerFeatureID, int *errorCode, int *indices, int length); + + + /* Get one or more pixel binning features */ + int getNumberOfPixelBinningFeatures(); + int getPixelBinningFeatures(long *buffer, int maxFeatures); + void binningSetPixelBinningFactor(long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor); + unsigned char binningGetPixelBinningFactor(long spectrometerFeatureID, int *errorCode); + void binningSetDefaultPixelBinningFactor(long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor); + void binningSetDefaultPixelBinningFactor(long spectrometerFeatureID, int *errorCode); + unsigned char binningGetDefaultPixelBinningFactor(long spectrometerFeatureID, int *errorCode); + unsigned char binningGetMaxPixelBinningFactor(long spectrometerFeatureID, int *errorCode); + + /* Get one or more TEC features */ + int getNumberOfThermoElectricFeatures(); + int getThermoElectricFeatures(long *buffer, int maxFeatures); + double tecReadTemperatureDegreesC(long featureID, int *errorCode); + void tecSetTemperatureSetpointDegreesC(long featureID, int *errorCode, + double temperatureDegreesCelsius); + void tecSetEnable(long featureID, int *errorCode, bool tecEnable); + + /* Get one or more irradiance calibration features */ + int getNumberOfIrradCalFeatures(); + int getIrradCalFeatures(long *buffer, int maxFeatures); + int irradCalibrationRead(long featureID, + int *errorCode, float *buffer, int bufferLength); + int irradCalibrationWrite(long featureID, + int *errorCode, float *buffer, int bufferLength); + int irradCalibrationHasCollectionArea(long featureID, int *errorCode); + float irradCalibrationReadCollectionArea(long featureID, int *errorCode); + void irradCalibrationWriteCollectionArea(long featureID, + int *errorCode, float area); + + /* Get one or more EEPROM features */ + int getNumberOfEEPROMFeatures(); + int getEEPROMFeatures(long *buffer, int maxFeatures); + int eepromReadSlot(long featureID, int *errorCode, int slotNumber, + unsigned char *buffer, int length); + + /* Get one or more light source features */ + int getNumberOfLightSourceFeatures(); + int getLightSourceFeatures(long *buffer, int maxFeatures); + int lightSourceGetCount(long featureID, int *errorCode); + bool lightSourceHasEnable(long featureID, int *errorCode, + int lightSourceIndex); + bool lightSourceIsEnabled(long featureID, int *errorCode, + int lightSourceIndex); + void lightSourceSetEnable(long featureID, int *errorCode, + int lightSourceIndex, bool enable); + bool lightSourceHasVariableIntensity(long featureID, int *errorCode, + int lightSourceIndex); + double lightSourceGetIntensity(long featureID, int *errorCode, + int lightSourceIndex); + void lightSourceSetIntensity(long featureID, int *errorCode, + int lightSourceIndex, double intensity); + + /* Get one or more strobe lamp enable features */ + int getNumberOfStrobeLampFeatures(); + int getStrobeLampFeatures(long *buffer, int maxFeatures); + void lampSetStrobeEnable(long featureID, int *errorCode, bool strobeEnable); + + /* Get one or more continuous strobe features */ + int getNumberOfContinuousStrobeFeatures(); + int getContinuousStrobeFeatures(long *buffer, int maxFeatures); + void continuousStrobeSetPeriodMicroseconds(long featureID, int *errorCode, + unsigned long period_usec); + void continuousStrobeSetEnable(long featureID, int *errorCode, bool enable); + + /* Get one or more shutter features */ + int getNumberOfShutterFeatures(); + int getShutterFeatures(long *buffer, int maxFeatures); + void shutterSetShutterOpen(long featureID, int *errorCode, bool opened); + + /* Get one or more nonlinearity coefficients features */ + int getNumberOfNonlinearityCoeffsFeatures(); + int getNonlinearityCoeffsFeatures(long *buffer, int maxFeatures); + int nonlinearityCoeffsGet(long featureID, int *errorCode, + double *buffer, int bufferLength); + + /* Get one or more temperature features */ + int getNumberOfTemperatureFeatures(); + int getTemperatureFeatures(long *buffer, int maxFeatures); + unsigned char temperatureCountGet(long temperatureFeatureID, int *errorCode); + double temperatureGet(long temperatureFeatureID, int *errorCode, int index); + int temperatureGetAll(long temperatureFeatureID, int *errorCode, + double *buffer, int bufferLength); + + /* Get one or more revision features */ + int getNumberOfRevisionFeatures(); + int getRevisionFeatures(long *buffer, int maxFeatures); + unsigned char revisionHardwareGet(long revisionFeatureID, int *errorCode); + unsigned short int revisionFirmwareGet(long revisionFeatureID, int *errorCode); + + /* Get one or more spectrum processing features */ + int getNumberOfSpectrumProcessingFeatures(); + int getSpectrumProcessingFeatures(long *buffer, int maxFeatures); + unsigned short int spectrumProcessingScansToAverageGet(long spectrumProcessingFeatureID, int *errorCode); + unsigned char spectrumProcessingBoxcarWidthGet(long spectrumProcessingFeatureID, int *errorCode); + void spectrumProcessingBoxcarWidthSet(long featureID, int *errorCode, unsigned char boxcarWidth); + void spectrumProcessingScansToAverageSet(long featureID, int *errorCode, unsigned short int scansToAverage); + + /* Get one or more optical bench features */ + int getNumberOfOpticalBenchFeatures(); + int getOpticalBenchFeatures(long *buffer, int maxFeatures); + unsigned short int opticalBenchGetFiberDiameterMicrons(long opticalBenchFeatureID, int *errorCode); + unsigned short int opticalBenchGetSlitWidthMicrons(long opticalBenchFeatureID, int *errorCode); + int opticalBenchGetID(long opticalBenchFeatureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetSerialNumber(long opticalBenchFeatureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetCoating(long opticalBenchFeatureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetFilter(long opticalBenchFeatureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetGrating(long opticalBenchFeatureID, int *errorCode, char *buffer, int bufferLength); + + + /* Get one or more stray light coefficients features */ + int getNumberOfStrayLightCoeffsFeatures(); + int getStrayLightCoeffsFeatures(long *buffer, int maxFeatures); + int strayLightCoeffsGet(long featureID, int *errorCode, + double *buffer, int bufferLength); + + /* Get one or more data buffer features */ + int getNumberOfDataBufferFeatures(); + int getDataBufferFeatures(long *buffer, int maxFeatures); + void dataBufferClear(long featureID, int *errorCode); + unsigned long dataBufferGetNumberOfElements(long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacity(long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacityMaximum(long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacityMinimum(long featureID, int *errorCode); + void dataBufferSetBufferCapacity(long featureID, int *errorCode, unsigned long capacity); + + /* Get one or more acquisition delay features */ + int getNumberOfAcquisitionDelayFeatures(); + int getAcquisitionDelayFeatures(long *buffer, int maxFeatures); + void acquisitionDelaySetDelayMicroseconds(long featureID, int *errorCode, + unsigned long delay_usec); + unsigned long acquisitionDelayGetDelayMicroseconds(long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayIncrementMicroseconds(long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayMaximumMicroseconds(long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayMinimumMicroseconds(long featureID, int *errorCode); + + protected: + unsigned long instanceID; + seabreeze::Device *device; + std::vector rawUSBBusAccessFeatures; + std::vector serialNumberFeatures; + std::vector spectrometerFeatures; + std::vector tecFeatures; + std::vector irradCalFeatures; + std::vector eepromFeatures; + std::vector lightSourceFeatures; + std::vector strobeLampFeatures; + std::vector continuousStrobeFeatures; + std::vector shutterFeatures; + std::vector nonlinearityFeatures; + std::vector temperatureFeatures; + std::vector revisionFeatures; + std::vector opticalBenchFeatures; + std::vector spectrumProcessingFeatures; + std::vector strayLightFeatures; + std::vector pixelBinningFeatures; + std::vector dataBufferFeatures; + std::vector acquisitionDelayFeatures; + + RawUSBBusAccessFeatureAdapter *getRawUSBBusAccessFeatureByID(long featureID); + SerialNumberFeatureAdapter *getSerialNumberFeatureByID(long featureID); + SpectrometerFeatureAdapter *getSpectrometerFeatureByID(long featureID); + ThermoElectricCoolerFeatureAdapter *getTECFeatureByID(long featureID); + IrradCalFeatureAdapter *getIrradCalFeatureByID(long featureID); + EEPROMFeatureAdapter *getEEPROMFeatureByID(long featureID); + LightSourceFeatureAdapter *getLightSourceFeatureByID(long featureID); + StrobeLampFeatureAdapter *getStrobeLampFeatureByID(long featureID); + ContinuousStrobeFeatureAdapter *getContinuousStrobeFeatureByID(long featureID); + ShutterFeatureAdapter *getShutterFeatureByID(long featureID); + NonlinearityCoeffsFeatureAdapter *getNonlinearityCoeffsFeatureByID(long featureID); + TemperatureFeatureAdapter *getTemperatureFeatureByID(long featureID); + RevisionFeatureAdapter *getRevisionFeatureByID(long featureID); + OpticalBenchFeatureAdapter *getOpticalBenchFeatureByID(long featureID); + SpectrumProcessingFeatureAdapter *getSpectrumProcessingFeatureByID(long featureID); + StrayLightCoeffsFeatureAdapter *getStrayLightCoeffsFeatureByID(long featureID); + PixelBinningFeatureAdapter *getPixelBinningFeatureByID(long featureID); + DataBufferFeatureAdapter *getDataBufferFeatureByID(long featureID); + AcquisitionDelayFeatureAdapter *getAcquisitionDelayFeatureByID(long featureID); + }; + } +} + +#endif + diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/EEPROMFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/EEPROMFeatureAdapter.h new file mode 100644 index 0000000..f64e321 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/EEPROMFeatureAdapter.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file EEPROMFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze EEPROMFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_EEPROMFEATUREADAPTER_H +#define SEABREEZE_EEPROMFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class EEPROMFeatureAdapter + : public FeatureAdapterTemplate { + public: + EEPROMFeatureAdapter(EEPROMSlotFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~EEPROMFeatureAdapter(); + + /* EEPROM functions */ + int readEEPROMSlot(int *errorCode, int slotNumber, + unsigned char *buffer, int bufferLength); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterInterface.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterInterface.h new file mode 100644 index 0000000..41ad782 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterInterface.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file FeatureAdapterInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This interface allows device features to be treated + * consistently regardless of the actual capabilities. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FEATUREADAPTERINTERFACE_H +#define SEABREEZE_FEATUREADAPTERINTERFACE_H + +#include "common/features/FeatureFamily.h" + +namespace seabreeze { + namespace api { + + class FeatureAdapterInterface { + public: + virtual ~FeatureAdapterInterface() = 0; + + /* This gets a semi-unique integer ID for this feature instance */ + virtual long getID() = 0; + + /* Gets the general category of the feature, if any */ + virtual FeatureFamily &getFeatureFamily() = 0; + }; + + /* Default empty destructor for otherwise abstract class */ + inline FeatureAdapterInterface::~FeatureAdapterInterface() { } + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterTemplate.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterTemplate.h new file mode 100644 index 0000000..6bdc267 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureAdapterTemplate.h @@ -0,0 +1,87 @@ +/***************************************************//** + * @file FeatureAdapterTemplate.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a templated wrapper around SeaBreeze Feature + * instances. This should make it easier to obtain a + * particular Feature to call methods against. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 FEATUREADAPTERTEMPLATE_H +#define FEATUREADAPTERTEMPLATE_H + +#include "api/seabreezeapi/FeatureAdapterInterface.h" +#include "common/buses/Bus.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "common/features/FeatureFamily.h" +#include "common/protocols/Protocol.h" +#include + +namespace seabreeze { + namespace api { + + template class FeatureAdapterTemplate + : public FeatureAdapterInterface { + public: + FeatureAdapterTemplate(T *featureInterface, const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex) { + this->feature = featureInterface; + this->family = f; + this->protocol = p; + this->bus = b; + this->index = instanceIndex; + + /* Create a unique ID based on the feature type and index. This + * might be expanded in the future to use one of the bytes for + * the feature type or index as a module number. + */ + this->ID = (family.getType() << 16) | (instanceIndex & 0x00FFFF); + + if(0 == this->feature || 0 == this->protocol || 0 == this->bus) { + std::string error("Null feature interface, protocol, or bus is not allowed."); + throw IllegalArgumentException(error); + } + } + virtual ~FeatureAdapterTemplate() { /* Do nothing -- others delete feature */ } + T *getFeature() { return this->feature; } + + virtual FeatureFamily &getFeatureFamily() { return this->family; } + + virtual long getID() { return this->ID; } + + protected: + T *feature; + FeatureFamily family; + Protocol *protocol; + Bus *bus; + unsigned short index; + unsigned long ID; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureFamilies.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureFamilies.h new file mode 100644 index 0000000..cd18080 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/FeatureFamilies.h @@ -0,0 +1,200 @@ +/***************************************************//** + * @file FeatureFamilies.h + * @date February 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This provides a way to get references to different kinds + * of features (e.g. spectrometer, TEC) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FEATUREFAMILIES_H +#define SEABREEZE_FEATUREFAMILIES_H + +#include "common/features/FeatureFamily.h" +#include + +namespace seabreeze { + namespace api { + + class UndefinedFeatureFamily : public FeatureFamily { + public: + UndefinedFeatureFamily(); + virtual ~UndefinedFeatureFamily(); + }; + + class SerialNumberFeatureFamily : public FeatureFamily { + public: + SerialNumberFeatureFamily(); + virtual ~SerialNumberFeatureFamily(); + }; + + class SpectrometerFeatureFamily : public FeatureFamily { + public: + SpectrometerFeatureFamily(); + virtual ~SpectrometerFeatureFamily(); + }; + + class ThermoElectricFeatureFamily : public FeatureFamily { + public: + ThermoElectricFeatureFamily(); + virtual ~ThermoElectricFeatureFamily(); + }; + + class IrradCalFeatureFamily : public FeatureFamily { + public: + IrradCalFeatureFamily(); + virtual ~IrradCalFeatureFamily(); + }; + + class EEPROMFeatureFamily : public FeatureFamily { + public: + EEPROMFeatureFamily(); + virtual ~EEPROMFeatureFamily(); + }; + + class LightSourceFeatureFamily : public FeatureFamily { + public: + LightSourceFeatureFamily(); + virtual ~LightSourceFeatureFamily(); + }; + + class StrobeLampFeatureFamily : public FeatureFamily { + public: + StrobeLampFeatureFamily(); + virtual ~StrobeLampFeatureFamily(); + }; + + class ContinuousStrobeFeatureFamily : public FeatureFamily { + public: + ContinuousStrobeFeatureFamily(); + virtual ~ContinuousStrobeFeatureFamily(); + }; + + class ShutterFeatureFamily : public FeatureFamily { + public: + ShutterFeatureFamily(); + virtual ~ShutterFeatureFamily(); + }; + + class WaveCalFeatureFamily : public FeatureFamily { + public: + WaveCalFeatureFamily(); + virtual ~WaveCalFeatureFamily(); + }; + + class NonlinearityCoeffsFeatureFamily : public FeatureFamily { + public: + NonlinearityCoeffsFeatureFamily(); + virtual ~NonlinearityCoeffsFeatureFamily(); + }; + + class TemperatureFeatureFamily : public FeatureFamily { + public: + TemperatureFeatureFamily(); + virtual ~TemperatureFeatureFamily(); + }; + + class RevisionFeatureFamily : public FeatureFamily { + public: + RevisionFeatureFamily(); + virtual ~RevisionFeatureFamily(); + }; + + class OpticalBenchFeatureFamily : public FeatureFamily { + public: + OpticalBenchFeatureFamily(); + virtual ~OpticalBenchFeatureFamily(); + }; + + class SpectrumProcessingFeatureFamily : public FeatureFamily { + public: + SpectrumProcessingFeatureFamily(); + virtual ~SpectrumProcessingFeatureFamily(); + }; + + class StrayLightCoeffsFeatureFamily : public FeatureFamily { + public: + StrayLightCoeffsFeatureFamily(); + virtual ~StrayLightCoeffsFeatureFamily(); + }; + + class RawUSBBusAccessFeatureFamily : public FeatureFamily { + public: + RawUSBBusAccessFeatureFamily(); + virtual ~RawUSBBusAccessFeatureFamily(); + }; + + class DataBufferFeatureFamily : public FeatureFamily { + public: + DataBufferFeatureFamily(); + virtual ~DataBufferFeatureFamily(); + }; + + class AcquisitionDelayFeatureFamily : public FeatureFamily { + public: + AcquisitionDelayFeatureFamily(); + virtual ~AcquisitionDelayFeatureFamily(); + }; + + class PixelBinningFeatureFamily : public FeatureFamily { + public: + PixelBinningFeatureFamily(); + virtual ~PixelBinningFeatureFamily(); + }; + + class FeatureFamilies { + public: + const UndefinedFeatureFamily UNDEFINED; + const SerialNumberFeatureFamily SERIAL_NUMBER; + const SpectrometerFeatureFamily SPECTROMETER; + const ThermoElectricFeatureFamily THERMOELECTRIC; + const IrradCalFeatureFamily IRRAD_CAL; + const EEPROMFeatureFamily EEPROM; + const LightSourceFeatureFamily LIGHT_SOURCE; + const StrobeLampFeatureFamily STROBE_LAMP_ENABLE; + const ContinuousStrobeFeatureFamily CONTINUOUS_STROBE; + const ShutterFeatureFamily SHUTTER; + const WaveCalFeatureFamily WAVELENGTH_CAL; + const NonlinearityCoeffsFeatureFamily NONLINEARITY_COEFFS; + const TemperatureFeatureFamily TEMPERATURE; + const RevisionFeatureFamily REVISION; + const OpticalBenchFeatureFamily OPTICAL_BENCH; + const SpectrumProcessingFeatureFamily SPECTRUM_PROCESSING; + const StrayLightCoeffsFeatureFamily STRAY_LIGHT_COEFFS; + const RawUSBBusAccessFeatureFamily RAW_USB_BUS_ACCESS; + const DataBufferFeatureFamily DATA_BUFFER; + const AcquisitionDelayFeatureFamily ACQUISITION_DELAY; + const PixelBinningFeatureFamily PIXEL_BINNING; + + FeatureFamilies(); + ~FeatureFamilies(); + std::vector getAllFeatureFamilies(); + }; + } +} + +#endif + diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/IrradCalFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/IrradCalFeatureAdapter.h new file mode 100644 index 0000000..e6180c1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/IrradCalFeatureAdapter.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file IrradCalFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze IrradCalFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_IRRADCALFEATUREADAPTER_H +#define SEABREEZE_IRRADCALFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/irradcal/IrradCalFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class IrradCalFeatureAdapter + : public FeatureAdapterTemplate { + public: + IrradCalFeatureAdapter(IrradCalFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~IrradCalFeatureAdapter(); + + int readIrradCalibration(int *errorCode, float *buffer, + int bufferLength); + int writeIrradCalibration(int *errorCode, float *buffer, + int bufferLength); + int hasIrradCollectionArea(int *errorCode); + float readIrradCollectionArea(int *errorCode); + void writeIrradCollectionArea(int *errorCode, float area); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/LightSourceFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/LightSourceFeatureAdapter.h new file mode 100644 index 0000000..f55ffd4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/LightSourceFeatureAdapter.h @@ -0,0 +1,69 @@ +/***************************************************//** + * @file LightSourceFeatureAdapter.h + * @date May 2013 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze LightSourceFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_LIGHTSOURCEFEATUREADAPTER_H +#define SEABREEZE_LIGHTSOURCEFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/light_source/LightSourceFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class LightSourceFeatureAdapter + : public FeatureAdapterTemplate { + public: + LightSourceFeatureAdapter(LightSourceFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~LightSourceFeatureAdapter(); + + int getLightSourceCount(int *errorCode); + + bool hasLightSourceEnable(int *errorCode, int lightSourceIndex); + bool isLightSourceEnabled(int *errorCode, int lightSourceIndex); + void setLightSourceEnable(int *errorCode, int lightSourceIndex, + bool enable); + + /* The intensity is normalized over the range [0, 1] where 0 is + * the minimum programmable intensity and 1 is the maximum + */ + bool hasVariableIntensity(int *errorCode, int lightSourceIndex); + double getLightSourceIntensity(int *errorCode, int lightSourceIndex); + void setLightSourceIntensity(int *errorCode, int lightSourceIndex, + double intensity); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/NonlinearityCoeffsFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/NonlinearityCoeffsFeatureAdapter.h new file mode 100644 index 0000000..33b046d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/NonlinearityCoeffsFeatureAdapter.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file NonlinearityCoeffsFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze NonlinearityCoeffFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_NONLINEARITYCOEFFSFEATUREADAPTER_H +#define SEABREEZE_NONLINEARITYCOEFFSFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class NonlinearityCoeffsFeatureAdapter + : public FeatureAdapterTemplate { + public: + NonlinearityCoeffsFeatureAdapter(NonlinearityCoeffsFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~NonlinearityCoeffsFeatureAdapter(); + + int readNonlinearityCoeffs(int *errorCode, double *buffer, + int bufferLength); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/OpticalBenchFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/OpticalBenchFeatureAdapter.h new file mode 100644 index 0000000..4f6eb53 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/OpticalBenchFeatureAdapter.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file OpticalBenchFeatureAdapter.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a wrapper that allows + * access to SeaBreeze TemperatureFeatureInterface instances. + * + * 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_OPTICALBENCHFEATUREADAPTER_H +#define SEABREEZE_OPTICALBENCHFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/optical_bench/OpticalBenchFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class OpticalBenchFeatureAdapter + : public FeatureAdapterTemplate { + public: + OpticalBenchFeatureAdapter(OpticalBenchFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~OpticalBenchFeatureAdapter(); + + unsigned short int readOpticalBenchFiberDiameterMicrons(int *errorCode); + unsigned short int readOpticalBenchSlitWidthMicrons(int *errorCode); + int readOpticalBenchID(int *errorCode, char *buffer, int buffer_length); + int readOpticalBenchSerialNumber(int *errorCode, char *buffer, int buffer_length); + int readOpticalBenchCoating(int *errorCode, char *buffer, int buffer_length); + int readOpticalBenchFilter(int *errorCode, char *buffer, int buffer_length); + int readOpticalBenchGrating(int *errorCode, char *buffer, int buffer_length); + }; + + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/PixelBinningFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/PixelBinningFeatureAdapter.h new file mode 100644 index 0000000..7cba13f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/PixelBinningFeatureAdapter.h @@ -0,0 +1,68 @@ +/***************************************************//** + * @file PixelBinningFeatureAdapter.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows access to SeaBreeze + * TECFeatureInterface instances. + * + * 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_PIXEL_BINNING_FEATURE_ADAPTER_H +#define SEABREEZE_PIXEL_BINNING_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/pixel_binning/PixelBinningFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class PixelBinningFeatureAdapter + : public FeatureAdapterTemplate { + public: + PixelBinningFeatureAdapter(PixelBinningFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~PixelBinningFeatureAdapter(); + + /* Thermoelectric cooler functions */ + unsigned char getPixelBinningFactor(int *errorCode); + + void setPixelBinningFactor(int *errorCode, + const unsigned char binningFactor); + + unsigned char getDefaultPixelBinningFactor(int *errorCode); + + void setDefaultPixelBinningFactor(int *errorCode, + const unsigned char binningFactor); + + void setDefaultPixelBinningFactor(int *errorCode); + + unsigned char getMaxPixelBinningFactor(int *errorCode); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ProtocolFamilies.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ProtocolFamilies.h new file mode 100644 index 0000000..8e0dbd4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ProtocolFamilies.h @@ -0,0 +1,87 @@ +/***************************************************//** + * @file ProtocolFamilies.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This provides a way to describe different kinds + * protocols (e.g. OOI, OBP) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLFAMILIES_H +#define SEABREEZE_PROTOCOLFAMILIES_H + +#include "common/protocols/ProtocolFamily.h" +#include + +namespace seabreeze { + namespace api { + + class UndefinedProtocolFamily : public ProtocolFamily { + public: + UndefinedProtocolFamily(); + virtual ~UndefinedProtocolFamily(); + }; + + class OOIProtocolFamily : public ProtocolFamily { + public: + OOIProtocolFamily(); + virtual ~OOIProtocolFamily(); + }; + + class OceanBinaryProtocolFamily : public ProtocolFamily { + public: + OceanBinaryProtocolFamily(); + virtual ~OceanBinaryProtocolFamily(); + }; + + class JazMessagingProtocolFamily : public ProtocolFamily { + public: + JazMessagingProtocolFamily(); + virtual ~JazMessagingProtocolFamily(); + }; + + class VirtualProtocolFamily : public ProtocolFamily { + public: + VirtualProtocolFamily(); + virtual ~VirtualProtocolFamily(); + }; + + class ProtocolFamilies { + public: + const UndefinedProtocolFamily UNDEFINED_PROTOCOL; + const OOIProtocolFamily OOI_PROTOCOL; + const OceanBinaryProtocolFamily OCEAN_BINARY_PROTOCOL; + const JazMessagingProtocolFamily JAZ_MESSAGING_PROTOCOL; + const VirtualProtocolFamily VIRTUAL_PROTOCOL; + + ProtocolFamilies(); + ~ProtocolFamilies(); + std::vector getAllProtocolFamilies(); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RawUSBBusAccessFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RawUSBBusAccessFeatureAdapter.h new file mode 100644 index 0000000..c4e841f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RawUSBBusAccessFeatureAdapter.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file RawUSBBusAccessFeatureAdapter.h + * @date February 2015 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze RawUSBBusAccessFeatureInterface instances. + * + * 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_RAWUSBBUSACCESSFEATUREADAPTER_H +#define SEABREEZE_RAWUSBBUSACCESSFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class RawUSBBusAccessFeatureAdapter + : public FeatureAdapterTemplate { + public: + RawUSBBusAccessFeatureAdapter(RawUSBBusAccessFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~RawUSBBusAccessFeatureAdapter(); + + int readUSB(int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char usbEndpoint); + int writeUSB(int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char usbEndpoint); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RevisionFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RevisionFeatureAdapter.h new file mode 100644 index 0000000..d81040f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/RevisionFeatureAdapter.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file RevisionFeatureAdapter.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a wrapper that allows + * access to SeaBreeze RevisionFeatureInterface instances. + * + * 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_REVISIONFEATUREADAPTER_H +#define SEABREEZE_REVISIONFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/revision/RevisionFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class RevisionFeatureAdapter + : public FeatureAdapterTemplate { + public: + RevisionFeatureAdapter(RevisionFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~RevisionFeatureAdapter(); + + unsigned char readHardwareRevision(int *errorCode); + unsigned short int readFirmwareRevision(int *errorCode); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPI.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPI.h new file mode 100644 index 0000000..f0af007 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPI.h @@ -0,0 +1,2481 @@ +/***************************************************//** + * @file SeaBreezeAPI.h + * @date February 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is an interface to SeaBreeze that allows + * the user to connect to devices over USB and other buses. + * This is intended as a usable and extensible API. + * + * This provides a C interface to help with linkage. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SEABREEZEAPI_H +#define SEABREEZEAPI_H + +#include "api/DllDecl.h" + +#ifdef __cplusplus + +#include "api/seabreezeapi/DeviceAdapter.h" + +/*! + @brief This is an interface to SeaBreeze that allows + the user to connect to devices over USB and + other buses. This is intended as a usable and + extensible API. + + @note Detailed method documentation is available in + the analogous C functions in SeaBreezeAPI.h +*/ +class DLL_DECL SeaBreezeAPI { +public: + /** + * No public constructor. To use this class in C++, + * you must first call getInstance(). This provides + * a singleton: it is the same on every call. + */ + static SeaBreezeAPI *getInstance(); + + /** + * No public destructor. Call this to force memory cleanup. + */ + static void shutdown(); + + /** + * Use the probeDevices() method to force the driver to look for any + * device that can be found automatically. If this is not called then + * such devices will not be available for use. This should be used when + * attempting to find USB devices. + */ + int probeDevices(); + + /** + * Use the addIPv4DeviceLocation() method to specify that a device may be + * found on a TCP/IPv4 network on a given port. Once specified, + * the typical openDevice() function can be used to access it. + */ + int addTCPIPv4DeviceLocation(char *deviceTypeName, char *ipAddr, int port); + + /** + * Use the addRS232DeviceLocation() method to specify that a device may be + * found on a particular serial bus with a given baud rate. Once specified, + * the typical openDevice() function can be used to access it. + */ + int addRS232DeviceLocation(char *deviceTypeName, char *deviceBusPath, unsigned int baud); + + /** + * This provides the number of devices that have either been probed or + * manually specified. Devices are not opened automatically, but this can + * provide a bound for getDeviceIDs(). + */ + int getNumberOfDeviceIDs(); + + /** + * This provides a unique ID of each device that is detected or specified. + * The IDs are copied into the user-provided buffer. These IDs are weak + * references: attempting to access a device that no longer exists will cause + * an error value to be returned but should not cause any instability. + * The IDs may be entirely random, but a given ID will always refer to the + * same device for as long as the program is running. This will return the + * number of device IDs actually copied into the array or 0 on error. + */ + int getDeviceIDs(long *ids, unsigned long maxLength); + + /** + * This will attempt to open the bus connetion to the device with the given ID. + * Returns 0 on success, other value on error. + */ + int openDevice(long id, int *errorCode); + + /** + * This will attempt to close the bus connection to the device with the given ID. + */ + void closeDevice(long id, int *errorCode); + + /* Get a string that describes the type of device */ + int getDeviceType(long id, int *errorCode, char *buffer, unsigned int length); + + /* Get the usb endpoint address for a specified type of endpoint */ + unsigned char getDeviceEndpoint(long id, int *error_code, usbEndpointType endpointType); + + /* Get raw usb access capabilities */ + int getNumberOfRawUSBBusAccessFeatures(long deviceID, int *errorCode); + int getRawUSBBusAccessFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int rawUSBBusAccessRead(long deviceID, long featureID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint); + int rawUSBBusAccessWrite(long deviceID, long featureID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint); + + /* Serial number capabilities */ + int getNumberOfSerialNumberFeatures(long deviceID, int *errorCode); + int getSerialNumberFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int getSerialNumber(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + unsigned char getSerialNumberMaximumLength(long deviceID, long featureID, int *errorCode); + + /* Spectrometer capabilities */ + int getNumberOfSpectrometerFeatures(long id, int *errorCode); + int getSpectrometerFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void spectrometerSetTriggerMode(long deviceID, long spectrometerFeatureID, int *errorCode, int mode); + void spectrometerSetIntegrationTimeMicros(long deviceID, long spectrometerFeatureID, int *errorCode, unsigned long integrationTimeMicros); + unsigned long spectrometerGetMinimumIntegrationTimeMicros(long deviceID, long spectrometerFeatureID, int *errorCode); + unsigned long spectrometerGetMaximumIntegrationTimeMicros(long deviceID, long spectrometerFeatureID, int *errorCode); + double spectrometerGetMaximumIntensity(long deviceID, long spectrometerFeatureID, int *errorCode); + int spectrometerGetUnformattedSpectrumLength(long deviceID, long spectrometerFeatureID, int *errorCode); + int spectrometerGetUnformattedSpectrum(long deviceID, long spectrometerFeatureID, int *errorCode, unsigned char *buffer, int bufferLength); + int spectrometerGetFormattedSpectrumLength(long deviceID, long spectrometerFeatureID, int *errorCode); + int spectrometerGetFormattedSpectrum(long deviceID, long spectrometerFeatureID, int *errorCode, double *buffer, int bufferLength); + int spectrometerGetWavelengths(long deviceID, long spectrometerFeatureID, int *errorCode, double *wavelengths, int length); + int spectrometerGetElectricDarkPixelCount(long deviceID, long spectrometerFeatureID, int *errorCode); + int spectrometerGetElectricDarkPixelIndices(long deviceID, long spectrometerFeatureID, int *errorCode, int *indices, int length); + + /* Pixel binning capabilities */ + int getNumberOfPixelBinningFeatures(long id, int *errorCode); + int getPixelBinningFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void binningSetPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor); + unsigned char binningGetPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode); + void binningSetDefaultPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode, const unsigned char binningFactor); + void binningSetDefaultPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode); + unsigned char binningGetDefaultPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode); + unsigned char binningGetMaxPixelBinningFactor(long deviceID, long spectrometerFeatureID, int *errorCode); + + /* TEC capabilities */ + int getNumberOfThermoElectricFeatures(long deviceID, int *errorCode); + int getThermoElectricFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + double tecReadTemperatureDegreesC(long deviceID, long featureID, int *errorCode); + void tecSetTemperatureSetpointDegreesC(long deviceID, long featureID, int *errorCode, double temperatureDegreesCelsius); + void tecSetEnable(long deviceID, long featureID, int *errorCode, unsigned char tecEnable); + + /* Irradiance calibration features */ + int getNumberOfIrradCalFeatures(long deviceID, int *errorCode); + int getIrradCalFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int irradCalibrationRead(long deviceID, long featureID, int *errorCode, float *buffer, int bufferLength); + int irradCalibrationWrite(long deviceID, long featureID, int *errorCode, float *buffer, int bufferLength); + int irradCalibrationHasCollectionArea(long deviceID, long featureID, int *errorCode); + float irradCalibrationReadCollectionArea(long deviceID, long featureID, int *errorCode); + void irradCalibrationWriteCollectionArea(long deviceID, long featureID, int *errorCode, float area); + + /* EEPROM capabilities */ + int getNumberOfEEPROMFeatures(long deviceID, int *errorCode); + int getEEPROMFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int eepromReadSlot(long deviceID, long featureID, int *errorCode, int slotNumber, unsigned char *buffer, int bufferLength); + + /* Light source capabilities */ + int getNumberOfLightSourceFeatures(long deviceID, int *errorCode); + int getLightSourceFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int lightSourceGetCount(long deviceID, long featureID, int *errorCode); + bool lightSourceHasEnable(long deviceID, long featureID, int *errorCode, int lightSourceIndex); + bool lightSourceIsEnabled(long deviceID, long featureID, int *errorCode, int lightSourceIndex); + void lightSourceSetEnable(long deviceID, long featureID, int *errorCode, int lightSourceIndex, bool enable); + bool lightSourceHasVariableIntensity(long deviceID, long featureID, int *errorCode, int lightSourceIndex); + double lightSourceGetIntensity(long deviceID, long featureID, int *errorCode, int lightSourceIndex); + void lightSourceSetIntensity(long deviceID, long featureID, int *errorCode, int lightSourceIndex, double intensity); + + /* Lamp capabilities */ + int getNumberOfLampFeatures(long deviceID, int *errorCode); + int getLampFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void lampSetLampEnable(long deviceID, long featureID, int *errorCode, bool strobeEnable); + + /* Continuous strobe capabilities */ + int getNumberOfContinuousStrobeFeatures(long deviceID, int *errorCode); + int getContinuousStrobeFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void continuousStrobeSetContinuousStrobeEnable(long deviceID, long featureID, int *errorCode, bool strobeEnable); + void continuousStrobeSetContinuousStrobePeriodMicroseconds(long deviceID, long featureID, int *errorCode, unsigned long strobePeriodMicroseconds); + + /* Shutter capabilities */ + int getNumberOfShutterFeatures(long deviceID, int *errorCode); + int getShutterFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void shutterSetShutterOpen(long deviceID, long featureID, int *errorCode, bool opened); + + /* Nonlinearity coefficient capabilities */ + int getNumberOfNonlinearityCoeffsFeatures(long deviceID, int *errorCode); + int getNonlinearityCoeffsFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int nonlinearityCoeffsGet(long deviceID, long featureID, int *errorCode, double *buffer, int maxLength); + + /* Temperature capabilities */ + int getNumberOfTemperatureFeatures(long deviceID, int *errorCode); + int getTemperatureFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + unsigned char temperatureCountGet(long deviceID, long featureID, int *errorCode); + double temperatureGet(long deviceID, long featureID, int *errorCode, int index); + int temperatureGetAll(long deviceID, long featureID, int *errorCode, double *buffer, int maxLength); + + /* Spectrum processing capabilities */ + int getNumberOfSpectrumProcessingFeatures(long deviceID, int *errorCode); + int getSpectrumProcessingFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + unsigned char spectrumProcessingBoxcarWidthGet(long deviceID, long featureID, int *errorCode); + unsigned short int spectrumProcessingScansToAverageGet(long deviceID, long featureID, int *errorCode); + void spectrumProcessingBoxcarWidthSet(long deviceID, long featureID, int *errorCode, unsigned char boxcarWidth); + void spectrumProcessingScansToAverageSet(long deviceID, long featureID, int *errorCode, unsigned short int scansToAverage); + + /* Revision capabilities */ + int getNumberOfRevisionFeatures(long deviceID, int *errorCode); + int getRevisionFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + unsigned char revisionHardwareGet(long deviceID, long featureID, int *errorCode); + unsigned short int revisionFirmwareGet(long deviceID, long featureID, int *errorCode); + + /* Optical Bench capabilities */ + int getNumberOfOpticalBenchFeatures(long deviceID, int *errorCode); + int getOpticalBenchFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + unsigned short int opticalBenchGetFiberDiameterMicrons(long deviceID, long featureID, int *errorCode); + unsigned short int opticalBenchGetSlitWidthMicrons(long deviceID, long featureID, int *errorCode); + int opticalBenchGetID(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetSerialNumber(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetCoating(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetFilter(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + int opticalBenchGetGrating(long deviceID, long featureID, int *errorCode, char *buffer, int bufferLength); + + /* Stray light coefficient capabilities */ + int getNumberOfStrayLightCoeffsFeatures(long deviceID, int *errorCode); + int getStrayLightCoeffsFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + int strayLightCoeffsGet(long deviceID, long featureID, int *errorCode, double *buffer, int maxLength); + + /* Data buffer capabilities */ + int getNumberOfDataBufferFeatures(long deviceID, int *errorCode); + int getDataBufferFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void dataBufferClear(long deviceID, long featureID, int *errorCode); + unsigned long dataBufferGetNumberOfElements(long deviceID, long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacity(long deviceID, long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacityMaximum(long deviceID, long featureID, int *errorCode); + unsigned long dataBufferGetBufferCapacityMinimum(long deviceID, long featureID, int *errorCode); + void dataBufferSetBufferCapacity(long deviceID, long featureID, int *errorCode, unsigned long capacity); + + /* Acquisition delay capabilities */ + int getNumberOfAcquisitionDelayFeatures(long deviceID, int *errorCode); + int getAcquisitionDelayFeatures(long deviceID, int *errorCode, long *buffer, unsigned int maxLength); + void acquisitionDelaySetDelayMicroseconds(long deviceID, long featureID, + int *errorCode, unsigned long delay_usec); + unsigned long acquisitionDelayGetDelayMicroseconds(long deviceID, + long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayIncrementMicroseconds(long deviceID, + long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayMaximumMicroseconds(long deviceID, + long featureID, int *errorCode); + unsigned long acquisitionDelayGetDelayMinimumMicroseconds(long deviceID, + long featureID, int *errorCode); + +private: + SeaBreezeAPI(); + virtual ~SeaBreezeAPI(); + + seabreeze::api::DeviceAdapter *getDeviceByID(unsigned long id); + + static SeaBreezeAPI *instance; + + std::vector probedDevices; + std::vector specifiedDevices; +}; + +extern "C" { +#endif /* __cplusplus */ + + /* All of these C functions start with sbapi_ to prevent namespace + * collisions. + */ + + /** + * This should be called prior to any other sbapi_call. The API may + * recover gracefully if this is not called, but future releases may assume + * this is called first. This should be called synchronously -- a single + * thread should call this. + */ + + DLL_DECL void sbapi_initialize(); + + /** + * This may be called to free up any allocated memory being held by the + * driver interface. After this is called by any thread, sbapi_initialize + * should be called again before any other sbapi_ functions are used. + */ + DLL_DECL void sbapi_shutdown(); + + /** + * This specifies to the driver that a device of the given type might be + * found on the network at a given address and port. The driver will add + * the device type and location to the set of those that can be opened. + * + * @param deviceTypeName (Input) The name of a type of device. This can be + * one of the following: Jaz + * + * @param ipAddress (Input) The IPv4 address of the device. This should be + * in "dotted quads" notation, such as "192.168.1.100". + * + * @param port (Input) The network port to open on the device. This will + * depend on the device type; consult its datasheet. + * + * @return zero on success, non-zero on error + */ + DLL_DECL int + sbapi_add_TCPIPv4_device_location(char *deviceTypeName, char *ipAddress, + unsigned int port); + + /** + * This specifies to the driver that a device of the given type might be + * found on a particular RS232 bus (e.g. a COM port). The driver will add + * the device type and location to the set of those that can be opened. + * + * @param deviceTypeName (Input) The name of a type of device. This can be + * one of the following: QE-PRO, STS. + * + * @param deviceBusPath (Input) The location of the device on the RS232 bus. + * This will be a platform-specific location. Under Windows, this may + * be COM1, COM2, etc. Under Linux, this might be /dev/ttyS0, /dev/ttyS1, + * etc. + * + * @param baud (Input) Baud rate at which to open the device. This should + * be specified as the rate itself, e.g. 9600, 57600, or 115200. + * + * @return zero on success, non-zero on error + */ + DLL_DECL int + sbapi_add_RS232_device_location(char *deviceTypeName, char *deviceBusPath, + unsigned int baud); + + /** + * This causes a search for known devices on all buses that support + * autodetection. This does NOT automatically open any device -- that must + * still be done with the sbapi_open_device() function. Note that this + * should only be done by one thread at a time, and it is recommended that + * other threads avoid calling sbapi_get_number_of_device_ids() or + * sbapi_get_device_ids() while this is executing. Ideally, a single thread + * should be designated for all device discovery/get actions, and + * separate worker threads can be used for each device discovered. + * + * @return the total number of devices that have been found + * automatically. If called repeatedly, this will always return the + * number of devices most recently found, even if they have been + * found or opened previously. + */ + DLL_DECL int + sbapi_probe_devices(); + + /** + * This returns the total number of devices that are known either because + * they have been specified with sbapi_add_RS232_device_location or + * because they were probed on some bus. This can be used to bound the + * number of device references that can be gotten with + * sbapi_get_device_ids(). + * + * @return the total number of devices references that are available + * through sbapi_get_device_ids(). + */ + DLL_DECL int + sbapi_get_number_of_device_ids(); + + /** + * This will populate the provided buffer with up to max_ids of device + * references. These references must be used as the first parameter to + * most of the other sbapi_ calls. Each uniquely identifies a single + * device instance. + * + * @param ids (Output) an array of long integers that will be overwritten + * with the unique IDs of each known device. Note that these + * devices will not be open by default. + * @param max_ids (Input) the maximum number of IDs that may be written + * to the array + * + * @return The total number of device IDs that were written to the array. + * This may be zero on error. + */ + DLL_DECL int + sbapi_get_device_ids(long *ids, unsigned int max_ids); + + /** + * This function opens a device attached to the system. The device must + * be provided as a location ID from the sbapi_get_device_ids() + * function. Such locations can either be specified or probed using the + * other methods in this interface. + * + * @param id (Input) The location ID of a device to try to open. Only IDs + * that have been returned by a previous call to seabreeze_get_device_ids() + * are valid. + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * + * @return 0 if it opened a device successfully, or 1 if no device was opened + * (in which case the error_code variable will be set). + */ + DLL_DECL int + sbapi_open_device(long id, int *error_code); + + /** + * This function closes the spectrometer attached to the system. + * + * @param id (Input) The location ID of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + */ + DLL_DECL void + sbapi_close_device(long id, int *error_code); + + /** + * This function returns a description of the error denoted by + * error_code. + * + * @param error_code (Input) The integer error code to look up. Error codes + * may not be zero, but can be any non-zero integer (positive or + * negative). + * + * @return char *: A description in the form of a string that describes + * what the error was. + */ + DLL_DECL const char * + sbapi_get_error_string(int error_code); + + /** + * This function copies a string denoting the type of the device into the + * provided buffer. + * + * @param id (Input) The location ID of a device previously opened with + * sbapi_get_device_locations(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. This may be NULL. + * @param buffer (Output) Pointer to a user buffer that the name will be + * stored into. This may be one of the following: + * \li NONE: Used if no spectrometer is found (error_code will also be set) + * \li HR2000: Represents an HR2000 spectrometer + * \li HR2000PLUS: Represents an HR2000+ spectrometer + * \li HR4000: Represents an HR4000 spectrometer + * \li JAZ: Represents a Jaz spectrometer + * \li MAYA2000: Represents a MAYA2000 spectrometer + * \li MAYA2000PRO: Represents a MAYA2000PRO spectrometer + * \li MAYALSL: Represents a Maya-LSL spectrometer + * \li NIRQUEST256: Represents an NIRQUEST256 spectrometer + * \li NIRQUEST512: Represents an NIRQUEST512 spectrometer + * \li QE65000: Represents a QE65000 spectrometer + * \li STS: Represents an STS spectrometer + * \li Torus: Represents a Torus spectrometer + * \li USB2000: Represents a USB2000 spectrometer + * \li USB2000PLUS: Represents a USB2000+ spectrometer + * \li USB4000: Represents a USB4000 spectrometer + * + * @param length (Input) Maximum number of bytes that may be written to the + * buffer + * + * @return integral number of bytes actually written to the user buffer + */ + DLL_DECL int + sbapi_get_device_type(long id, int *error_code, + char *buffer, unsigned int length); + + /** + * This function returns the usb endpoint for the type specified. + * If the type is not supported by the device, a zero is returned. + * 0 is normally the control endpoint. That value is not valid in this context. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the usb endpoint address. + */ + DLL_DECL unsigned char + sbapi_get_device_usb_endpoint_primary_out(long id, int *error_code); + + /** + * This function returns the usb endpoint for the type specified. + * If the type is not supported by the device, a zero is returned. + * 0 is normally the control endpoint. That value is not valid in this context. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the usb endpoint address. + */ + DLL_DECL unsigned char + sbapi_get_device_usb_endpoint_primary_in(long id, int *error_code); + + /** + * This function returns the usb endpoint for the type specified. + * If the type is not supported by the device, a zero is returned. + * 0 is normally the control endpoint. That value is not valid in this context. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the usb endpoint address. + */ + DLL_DECL unsigned char + sbapi_get_device_usb_endpoint_secondary_out(long id, int *error_code); + + /** + * This function returns the usb endpoint for the type specified. + * If the type is not supported by the device, a zero is returned. + * 0 is normally the control endpoint. That value is not valid in this context. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the usb endpoint address. + */ + DLL_DECL unsigned char + sbapi_get_device_usb_endpoint_secondary_in(long id, int *error_code); + + /** + * This function returns the usb endpoint for the type specified. + * If the type is not supported by the device, a zero is returned. + * 0 is normally the control endpoint. That value is not valid in this context. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the usb endpoint address. + */ + DLL_DECL unsigned char + sbapi_get_device_usb_endpoint_secondary_in2(long id, int *error_code); + + + /** + * This function returns the total number of raw usb bus access feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of raw usb bus access features that will be + * returned by a call to sbapi_get_raw_usb_bus_access_features(). + */ + DLL_DECL int + sbapi_get_number_of_raw_usb_bus_access_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each raw usb bus access feature + * instance for this device. The IDs are only valid when used with the + * deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of raw usb bus access feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_raw_usb_bus_access_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function reads out a raw usb access from the spectrometer's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_raw_usb_access_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) preallocated array to hold an unsigned char buffer + * @param buffer_length (Input) size of the preallocated buffer (should equal pixel count) + * @param endpoint (Input) a USB endpoint gotten from one of the + * sbapi_get_device_usb_endpoint_xxx_xxx() type calls. + * + * @return the number of floats read from the device into the buffer + */ + DLL_DECL int + sbapi_raw_usb_bus_access_read(long deviceID, long featureID, + int *error_code, unsigned char *buffer, int buffer_length, unsigned char endpoint); + + /** + * This function writes a buffer of unsigned chars to the specified USB endpoint + * if the feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an raw usb bus access + * feature. Valid IDs can be found with the + * sbapi_get_raw_usb_bus_access_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) a pointer to unsigned char values to send to the usb endpoint + * @param buffer_length (Input) number of calibration factors to write + * @param endpoint (Input) a USB endpoint gotten from one of the + * sbapi_get_device_usb_endpoint_xxx_xxx() type calls. + * + * @return the number of floats written from the buffer to the device + */ + DLL_DECL int + sbapi_raw_usb_bus_access_write(long deviceID, long featureID, + int *error_code, unsigned char *buffer, int buffer_length, unsigned char endpoint); + + + /** + * This function returns the total number of serial number instances available + * in the indicated device. Each instance may refer to a different module. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the number of serial_number features that will be returned + * by a call to sbapi_get_serial_number_features(). + */ + DLL_DECL int + sbapi_get_number_of_serial_number_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each serial number instance for this + * device. Each instance refers to a single serial number feature. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * @param features (Output) a pre-allocated array to hold the list of + * supported serial number features + * @param max_features (Input) size of the preallocated output array + * @return the number of serial number feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_serial_number_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This reads the device's serial number and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_serial_number_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_get_serial_number(long deviceID, long featureID, int *error_code, + char *buffer, int buffer_length); + + /** + * This reads the possible maximum length of the device's serial number + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_serial_number_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the length of the serial number in an unsigned character byte + */ + DLL_DECL unsigned char + sbapi_get_serial_number_maximum_length(long deviceID, long featureID, int *error_code); + + /** + * This function returns the total number of spectrometer instances available + * in the indicated device. Each instance refers to a single optical bench. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @return the number of spectrometer features that will be returned + * by a call to sbapi_get_spectrometer_features(). + */ + DLL_DECL int + sbapi_get_number_of_spectrometer_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each spectrometer instance for this + * device. Each instance refers to a single optical bench. The IDs are only + * valid when used with the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * @param features (Output) a preallocated output array to hold the features + * @param max_features (Input) size of the preallocated output array + * @return Returns the number of spectrometer feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_spectrometer_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function sets the trigger mode for the specified device. + * Note that requesting an unsupported mode will result in an error. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param mode (Input) a trigger mode (0 = normal, 1 = software, + * 2 = synchronization, 3 = external hardware, etc - check your + * particular spectrometer's Data Sheet) + */ + DLL_DECL void + sbapi_spectrometer_set_trigger_mode(long deviceID, long featureID, + int *error_code, int mode); + + /** + * This function sets the integration time for the specified device. + * This function should not be responsible for performing stability + * scans. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param integration_time_micros (Input) The new integration time in + * units of microseconds + */ + DLL_DECL void + sbapi_spectrometer_set_integration_time_micros(long deviceID, long featureID, + int *error_code, unsigned long integration_time_micros); + + /** + * This function returns the smallest integration time setting, + * in microseconds, that is valid for the spectrometer. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) A pointer to an integer that can be used + * for storing error codes. + * @return Returns minimum legal integration time in microseconds if > 0. + * On error, returns -1 and error_code will be set accordingly. + */ + DLL_DECL long + sbapi_spectrometer_get_minimum_integration_time_micros(long deviceID, + long featureID, int *error_code); + + /** + * This function returns the maximum pixel intensity for the + * spectrometer. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) A pointer to an integer that can be used + * for storing error codes. + * @return Returns maximum pixel intensity if > 0. + * On error, returns -1 and error_code will be set accordingly. + */ + DLL_DECL double + sbapi_spectrometer_get_maximum_intensity(long deviceID, + long featureID, int *error_code); + + /** + * This returns an integer denoting the number of pixels in a + * formatted spectrum (as returned by get_formatted_spectrum(...)). + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrometer + * feature. Valid IDs can be found with the sbapi_get_spectrometer_features() + * function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the length of a formatted spectrum. + */ + DLL_DECL int + sbapi_spectrometer_get_formatted_spectrum_length(long deviceID, + long featureID, int *error_code); + + /** + * This acquires a spectrum and returns the answer in formatted + * floats. In this mode, auto-nulling should be automatically + * performed for devices that support it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A buffer (with memory already allocated) to + * hold the spectral data + * @param buffer_length (Input) The length of the buffer + * + * @return the number of floats read into the buffer + */ + DLL_DECL int + sbapi_spectrometer_get_formatted_spectrum(long deviceID, + long featureID, int *error_code, + double* buffer, int buffer_length); + + /** + * This returns an integer denoting the length of a raw spectrum + * (as returned by get_unformatted_spectrum(...)). + * + * @param deviceID (Input) The index of a device previously opened with + * open_spectrometer(). + * @param featureID (Input) The ID of a particular instance of a + * spectrometer feature. Valid IDs can be found with the + * sbapi_get_spectrometer_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the length of an unformatted spectrum. + */ + DLL_DECL int + sbapi_spectrometer_get_unformatted_spectrum_length(long deviceID, + long featureID, int *error_code); + + /** + * This acquires a spectrum and returns the answer in raw, + * unformatted bytes. + * + * @param deviceID (Input) The index of a device previously opened with + * open_spectrometer(). + * @param featureID (Input) The ID of a particular instance of a spectrometer + * feature. Valid IDs can be found with the sbapi_get_spectrometer_features() + * function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A buffer (with memory already allocated) to hold + * the spectral data + * @param buffer_length (Input) The length of the buffer + * + * @return the number of bytes read into the buffer + */ + DLL_DECL int + sbapi_spectrometer_get_unformatted_spectrum(long deviceID, + long featureID, int *error_code, + unsigned char *buffer, int buffer_length); + + /** + * This computes the wavelengths for the spectrometer and fills in the + * provided array (up to the given length) with those values. + * + * @param deviceID (Input) The index of a device previously opened with + * open_spectrometer(). + * @param featureID (Input) The ID of a particular instance of a spectrometer + * feature. Valid IDs can be found with the sbapi_get_spectrometer_features() + * function. + * @param error_code (Ouput) pointer to an integer that can be used for storing + * error codes. + * @param wavelengths (Output) A pre-allocated array of doubles that the wavelengths + * will be copied into + * @param length (Input) The number of values to copy into the wavelength array + * (this should be no larger than the number of doubles allocated in the wavelengths + * array) + * + * @return the number of bytes written into the wavelength buffer + */ + DLL_DECL int + sbapi_spectrometer_get_wavelengths(long deviceID, + long featureID, int *error_code, double *wavelengths, int length); + + /** + * This returns the number of pixels that are electrically active but + * optically masked (a.k.a. electric dark pixels). Note that not all + * detectors have optically masked pixels; in that case, this function + * will return zero. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrometer + * feature. Valid IDs can be found with the sbapi_get_spectrometer_features() + * function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of pixels that can be retrieved by the + * sbapi_spectrometer_get_electric_dark_pixel_indices() function. + */ + DLL_DECL int + sbapi_spectrometer_get_electric_dark_pixel_count(long deviceID, + long featureID, int *error_code); + + /** + * This fills in the provided array (up to the given length) with the indices + * of the pixels that are electrically active but optically masked + * (a.k.a. electric dark pixels). Note that not all detectors have optically + * masked pixels; in that case, this function will return zero. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrometer + * feature. Valid IDs can be found with the sbapi_get_spectrometer_features() + * function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param indices (Output) A pre-allocated array of ints that the pixel indices + * will be copied into + * @param length (Input) The number of values to copy into the indices array + * (this should be no larger than the number of ints allocated in the indices + * array) + * + * @return the number of bytes written into the indices buffer + */ + DLL_DECL int + sbapi_spectrometer_get_electric_dark_pixel_indices(long deviceID, + long featureID, int *error_code, int *indices, int length); + + /** + * This function returns the total number of pixel binning instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the number of pixel binning features that will be returned by a call + * to sbapi_get_pixel_binning_features(). + */ + DLL_DECL int + sbapi_get_number_of_pixel_binning_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each pixel binning feature for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * @param features (Output) a pre-populated array to hold the returned + * feature handles + * @param max_features (Input) size of the pre-allocated array + * + * @return the number of pixel binning feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_pixel_binning_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function sets the pixel binning factor on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * @param factor (Input) The desired pixel binning factor. + */ + DLL_DECL void + sbapi_binning_set_pixel_binning_factor(long deviceID, long featureID, + int *error_code, unsigned char factor); + + /** + * This function gets the pixel binning factor on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * + * @return the pixel binning factor for the specified feature. + */ + DLL_DECL unsigned char + sbapi_binning_get_pixel_binning_factor(long deviceID, long featureID, int *error_code); + + /** + * This function sets the default pixel binning factor on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output)A pointer to an integer that can be used for + * storing error codes. + * @param factor (Input) The desired default pixel binning factor. + */ + DLL_DECL void + sbapi_binning_set_default_pixel_binning_factor(long deviceID, long featureID, + int *error_code, unsigned char factor); + + /** + * This function resets the default pixel binning factor on the device back to the factory default. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output)A pointer to an integer that can be used for + * storing error codes. + */ + DLL_DECL void + sbapi_binning_reset_default_pixel_binning_factor(long deviceID, long featureID, + int *error_code); + + /** + * This function gets the default pixel binning factor on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output)A pointer to an integer that can be used for + * storing error codes. + * + * @return the default pixel binning factor for the specified feature. + */ + DLL_DECL unsigned char + sbapi_binning_get_default_pixel_binning_factor(long deviceID, long featureID, int *error_code); + + /** + * This function gets the maximum pixel binning factor on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a pixel binning feature. + * Valid IDs can be found with the sbapi_get_pixel_binning_features() function. + * @param error_code (Output)A pointer to an integer that can be used for + * storing error codes. + * + * @return the maximum pixel binning factor for the specified feature. + */ + DLL_DECL unsigned char + sbapi_binning_get_max_pixel_binning_factor(long deviceID, long featureID, int *error_code); + + /** + * This function returns the total number of shutter instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the number of shutter features that will be returned by a call + * to sbapi_get_shutter_features(). + */ + DLL_DECL int + sbapi_get_number_of_shutter_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each shutter instance for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for + * storing error codes. + * @param features (Output) a pre-populated array to hold the returned + * feature handles + * @param max_features (Input) size of the pre-allocated array + * + * @return the number of shutter feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_shutter_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function sets the shutter state on the device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a shutter feature. + * Valid IDs can be found with the sbapi_get_shutter_features() function. + * @param error_code (Output)A pointer to an integer that can be used for + * storing error codes. + * @param opened (Input) A boolean used for denoting the desired state + * (opened/closed) of the shutter. If the value of + * opened is non-zero, then the shutter will open. If + * the value of opened is zero, then the shutter will close. + */ + DLL_DECL void + sbapi_shutter_set_shutter_open(long deviceID, long featureID, + int *error_code, unsigned char opened); + + /** + * This function returns the total number of light source instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the number of light source features that will be returned + * by a call to sbapi_get_light_source_features(). + */ + DLL_DECL int + sbapi_get_number_of_light_source_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each light source instance for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param features (Output) pre-allocated buffer that will receive the IDs of the + * feature instances + * @param max_features (Input) the maximum number of elements that can be + * copied into the provided features array + * + * @return the number of light source feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_light_source_features(long deviceID, int *error_code, + long *features, int max_features); + + /** + * This function gets the number of light sources that are represented by + * the given featureID. Such light sources could be individual LEDs, + * light bulbs, lasers, etc. Each of these light sources may have different + * capabilities, such as programmable intensities and enables, which should + * be queried before they are used. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source + * feature. Valid IDs can be found with sbapi_get_light_source_features(). + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * + * @return the number of light sources (e.g. bulbs) in the indicated feature + */ + DLL_DECL int + sbapi_light_source_get_count(long deviceID, long featureID, int *error_code); + + /** + * Queries whether the indicated light source within the given feature + * instance has a usable enable/disable control. If this returns 0 + * (meaning no enable available) then calling sbapi_light_source_set_enable() + * or sbapi_light_source_is_enabled() is likely to result in an error. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source + * feature. Valid IDs can be found with the sbapi_get_light_source_features() + * function. + * @param error_code (Ouput) A pointer to an integer that can be used for + * storing error codes. + * @param light_source_index (Input) Which of potentially many light sources + * (LEDs, lasers, light bulbs) within the indicated feature instance to query + * + * @return 0 to indicate specified light source cannot be enabled/disabled, + * 1 to indicate specified light source can be enabled/disabled with + * sbapi_light_source_set_enable() + */ + DLL_DECL unsigned char + sbapi_light_source_has_enable(long deviceID, long featureID, int *error_code, + int light_source_index); + + /** + * Queries whether the indicated light source within the given feature + * instance is enabled (energized). + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source feature. Valid + * IDs can be found with the sbapi_get_light_source_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_source_index (Input) Which of potentially many light sources (LEDs, lasers, + * light bulbs) within the indicated feature instance to query + * + * @return 0 to indicate specified light source is disabled (should emit no light), + * 1 to indicate specified light source is enabled (should emit light depending + * on configured intensity setting) + */ + DLL_DECL unsigned char + sbapi_light_source_is_enabled(long deviceID, long featureID, int *error_code, + int light_source_index); + + /** + * Attempts to enable or disable the indicated light source within the given + * feature instance. Not all light sources have an enable/disable control, + * and this capability can be queried with sbapi_light_source_has_enable(). + * Note that an enabled light source should emit light according to its last + * (or default) intensity setting which might be the minimum; in this case, + * the light source might appear to remain off. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source feature. Valid + * IDs can be found with the sbapi_get_light_source_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_source_index (Input) Which of potentially many light sources (LEDs, lasers, + * light bulbs) within the indicated feature instance to query + * @param enable (Input) Whether to enable the light source. A value of zero will attempt + * to disable the light source, and any other value will enable it. + */ + DLL_DECL void + sbapi_light_source_set_enable(long deviceID, long featureID, int *error_code, + int light_source_index, unsigned char enable); + + /** + * Queries whether the indicated light source within the given feature + * instance has a usable intensity control. If this returns 0 + * (meaning no control available) then calling sbapi_light_source_set_intensity() + * or sbapi_light_source_get_intensity() is likely to result in an error. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source feature. Valid + * IDs can be found with the sbapi_get_light_source_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_source_index (Input) Which of potentially many light sources (LEDs, lasers, + * light bulbs) within the indicated feature instance to query + * + * @return 0 to indicate specified light source cannot have its intensity changed, + * 1 to indicate the specified light source can have its intensity controlled + * with sbapi_light_source_set_intensity() + */ + DLL_DECL unsigned char + sbapi_light_source_has_variable_intensity(long deviceID, long featureID, + int *error_code, int light_source_index); + + /** + * Queries the intensity level of the indicated light source within the + * given feature instance. The intensity is normalized over the + * range [0, 1], with 0 as the minimum and 1 as the maximum. + * + * SAFETY WARNING: a light source at its minimum intensity (0) might still + * emit light, and in some cases, this may be harmful radiation. A value + * of 0 indicates the minimum of the programmable range for the light source, + * and does not necessarily turn the light source off. To disable a light + * source completely, use sbapi_light_source_set_enable() if the device + * supports this feature, or provide some other mechanism to allow the light + * to be disabled or blocked by the operator. + * + * In some cases, the intensity may refer to the duty cycle of a pulsed + * light source instead of a continuous power rating. The actual power output + * of the light source might not vary linearly with the reported intensity, + * so independent measurement or calibration of the light source may be + * necessary. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source feature. Valid + * IDs can be found with the sbapi_get_light_source_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_source_index (Input) Which of potentially many light sources (LEDs, lasers, + * light bulbs) within the indicated feature instance to query + * + * @return Real-valued result (as a double-precision floating point number) over + * the range [0, 1] where 0 represents the minimum programmable intensity + * level and 1 indicates the maximum. Note that the minimum intensity level + * might still allow the light source to produce light. + */ + DLL_DECL double + sbapi_light_source_get_intensity(long deviceID, long featureID, + int *error_code, int light_source_index); + + /** + * Sets the intensity level of the indicated light source within the + * given feature instance. The intensity is normalized over the + * range [0, 1], with 0 as the minimum and 1 as the maximum. + * + * SAFETY WARNING: a light source at its minimum intensity (0) might still + * emit light, and in some cases, this may be harmful radiation. A value + * of 0 indicates the minimum of the programmable range for the light source, + * and does not necessarily turn the light source off. To disable a light + * source completely, use sbapi_light_source_set_enable() if the device + * supports this feature, or provide some other mechanism to allow the light + * to be disabled or blocked by the operator. + * + * In some cases, the intensity may refer to the duty cycle of a pulsed + * light source instead of a continuous power rating. The actual power output + * of the light source might not vary linearly with the reported intensity, + * so independent measurement or calibration of the light source may be + * necessary. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a light source feature. Valid + * IDs can be found with the sbapi_get_light_source_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param light_source_index (Input) Which of potentially many light sources (LEDs, lasers, + * light bulbs) within the indicated feature instance to query + * @param intensity (Input) The target intensity of the light source in the range [0, 1] + */ + DLL_DECL void + sbapi_light_source_set_intensity(long deviceID, long featureID, + int *error_code, int light_source_index, double intensity); + + /* + * This function returns the total number of strobe/lamp instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of strobe/lamp features that will be returned + * by a call to sbapi_get_strobe_lamp_features(). + */ + +// There is not code in seabreezeAPI.cpp for this function. Perhaps it was not finished + + //DLL_DECL int + //sbapi_get_number_of_strobe_lamp_features(long deviceID, int *error_code); + + /* + * This function returns IDs for accessing each strobe/lamp instance for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of strobe/lamp feature IDs that were copied. + */ + +// There is not code in seabreezeAPI.cpp for this function. Perhaps it was not finished. + + //DLL_DECL int + //sbapi_get_strobe_lamp_features(long deviceID, int *error_code, long *features, + // int max_features); + + /** + * This function returns the total number of lamp instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of lamp features that will be returned + * by a call to sbapi_get_lamp_features(). + */ + DLL_DECL int + sbapi_get_number_of_lamp_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each lamp instance for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of lamp feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_lamp_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function sets the strobe enable on the spectrometer. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a lamp feature. Valid + * IDs can be found with the sbapi_get_lamp_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param lamp_enable (Input) A character used for denoting the desired value + * (high/low) of the strobe-enable pin. If the value of + * strobe_enable is zero, then the pin should be set low. If + * the value of strobe_enable is non-zero, then the pin should be + * set high. + */ + DLL_DECL void + sbapi_lamp_set_lamp_enable(long deviceID, long featureID, + int *error_code, unsigned char lamp_enable); + + /** + * This function returns the total number of continuous strobe instances + * available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of continuous strobe features that will be returned + * by a call to sbapi_get_continuous_strobe_features(). + */ + DLL_DECL int + sbapi_get_number_of_continuous_strobe_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each continuous strobe instance + * for this device. The IDs are only valid when used with the deviceID + * used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of continuous strobe feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_continuous_strobe_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function sets the continuous strobe enable state on the device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a continuous strobe feature. + * Valid IDs can be found with the sbapi_get_continuous_strobe_features() + * function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param enable (Input) A boolean used for denoting the desired state + * (on/off) of the continuous strobe generator. If the value of + * enable is nonzero, then the continuous strobe will operate. If + * the value of enable is zero, then the continuous strobe will stop. + * Note that on some devices the continuous strobe enable is tied to other + * enables (such as lamp enable or single strobe enable) which may cause + * side effects. + */ + DLL_DECL void + sbapi_continuous_strobe_set_continuous_strobe_enable(long deviceID, long featureID, + int *error_code, unsigned char enable); + + /** + * This function sets the continuous strobe period on the device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a continuous strobe feature. + * Valid IDs can be found with the sbapi_get_continuous_strobe_features() + * function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param period_micros (Input) The new period of the continous strobe measured in microseconds + */ + DLL_DECL void + sbapi_continuous_strobe_set_continuous_strobe_period_micros(long deviceID, long featureID, + int *error_code, unsigned long period_micros); + + /** + * This function returns the total number of EEPROM instances available + * in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of EEPROM features that will be returned + * by a call to sbapi_get_eeprom_features(). + */ + DLL_DECL int + sbapi_get_number_of_eeprom_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each EEPROM instance for this + * device. The IDs are only valid when used with the deviceID used to + * obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of EEPROM feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_eeprom_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function reads a string out of the device's EEPROM slot + * and returns the result. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an EEPROM feature. Valid + * IDs can be found with the sbapi_get_eeprom_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param slot_number (Input) The number of the slot to read out. Possible + * values are 0 through 17. + * @param buffer (Output) A buffer (with memory already allocated) to hold the + * value read out of the EEPROM slot + * @param buffer_length (Input) The length of the buffer + * + * @return the number of bytes read from the EEPROM slot into the buffer + */ + DLL_DECL int + sbapi_eeprom_read_slot(long deviceID, long featureID, + int *error_code, int slot_number, + unsigned char *buffer, int buffer_length); + + /** + * This function returns the total number of irradiance calibration + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of irradiance calibration features that will be + * returned by a call to sbapi_get_irrad_cal_features(). + */ + DLL_DECL int + sbapi_get_number_of_irrad_cal_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each irradiance calibration + * instance for this device. The IDs are only valid when used with the + * deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) a preallocated array to hold returned feature handles + * @param max_features (Input) length of the preallocated buffer + * + * @return the number of irradiance calibration feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_irrad_cal_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function reads out an irradiance calibration from the spectrometer's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_irrad_cal_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) preallocated array to hold irradiance calibration scalars (one per pixel) + * @param buffer_length (Input) size of the preallocated buffer (should equal pixel count) + * + * @return the number of floats read from the device into the buffer + */ + DLL_DECL int + sbapi_irrad_calibration_read(long deviceID, long featureID, + int *error_code, float *buffer, int buffer_length); + + /** + * This function writes an irradiance calibration to the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_irrad_cal_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) array of floating point values to store into the device + * @param buffer_length (Input) number of calibration factors to write + * + * @return the number of floats written from the buffer to the device + */ + DLL_DECL int + sbapi_irrad_calibration_write(long deviceID, long featureID, + int *error_code, float *buffer, int buffer_length); + + /** + * This function checks for an irradiance collection area in the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_irrad_cal_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return 0 if no collection area available, 1 if available. + */ + DLL_DECL int + sbapi_irrad_calibration_has_collection_area(long deviceID, long featureID, + int *error_code); + + /** + * This function reads an irradiance collection area from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_irrad_cal_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return float: collection area (usually in units of cm^2) read from device + */ + DLL_DECL float + sbapi_irrad_calibration_read_collection_area(long deviceID, long featureID, + int *error_code); + + /** + * This function writes an irradiance collection area to the spectrometer's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an irradiance calibration + * feature. Valid IDs can be found with the + * sbapi_get_irrad_cal_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param area (Input) collection area to save to spectrometer, presumably in cm^2 + */ + DLL_DECL void + sbapi_irrad_calibration_write_collection_area(long deviceID, long featureID, + int *error_code, float area); + + /** + * This function returns the total number of thermoelectric cooler (TEC) + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of TEC features that will be returned by a call to + * sbapi_get_thermoelectric_features(). + */ + DLL_DECL int + sbapi_get_number_of_thermo_electric_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each thermoelectric cooler + * (TEC) instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold feature handles + * @param max_features (Input) size of the preallocated array + * + * @return the number of TEC feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_thermo_electric_features(long deviceID, int *error_code, long *features, + int max_features); + + /** + * This function reads the actual temperature of the TEC and returns the value in + * degrees celsius. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an thermoelectric cooler + * feature. Valid IDs can be found with the + * sbapi_get_thermo_electric_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return double: The TEC temperature in degrees celsius. + */ + DLL_DECL double + sbapi_tec_read_temperature_degrees_C(long deviceID, long featureID, + int *error_code); + + /** + * This function sets the target (setpoint) TEC temperature. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an thermoelectric cooler + * feature. Valid IDs can be found with the + * sbapi_get_thermo_electric_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param temperature_degrees_celsius (Input) desired temperature, + * in degrees celsius. + */ + DLL_DECL void + sbapi_tec_set_temperature_setpoint_degrees_C(long deviceID, long featureID, + int *error_code, double temperature_degrees_celsius); + + /** + * This function enables the TEC feature on the device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of an thermoelectric cooler + * feature. Valid IDs can be found with the + * sbapi_get_thermo_electric_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param tec_enable (Input) A character that denotes the desired TEC enable + * state. If the value of tec_enable is zero, the TEC should + * be disabled. If the value of tec_enable is non-zero, the TEC + * should be enabled. + */ + DLL_DECL void + sbapi_tec_set_enable(long deviceID, long featureID, + int *error_code, unsigned char tec_enable); + + /** + * This function returns the total number of nonlinearity coefficient feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_nonlinearity_coeffs_features(). + */ + DLL_DECL int + sbapi_get_number_of_nonlinearity_coeffs_features( + long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each nonlinearity coefficient + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold returned feature handles + * @param max_features (Input) size of preallocated array + * + * @return the number of nonlinearity coefficient feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_nonlinearity_coeffs_features(long deviceID, int *error_code, + long *features, int max_features); + + /** + * This function reads out nonlinearity coefficients from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a nonlinearity coefficient + * feature. Valid IDs can be found with the + * sbapi_get_nonlinearity_coeffs_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) preallocated buffer to store NLC coefficients + * @param max_length (Input) size of preallocated buffer + * + * @return the number of doubles read from the device into the buffer + */ + DLL_DECL int sbapi_nonlinearity_coeffs_get(long deviceID, long featureID, + int *error_code, double *buffer, int max_length); + +/** + * This function returns the total number of temperature feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_temperature_features(). + */ + DLL_DECL int + sbapi_get_number_of_temperature_features( + long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each temperature + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold returned feature handles + * @param max_features (Input) size of preallocated array + * + * @return the number of temperature feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_temperature_features(long deviceID, int *error_code, + long *temperatureFeatures, int max_features); + + /** + * This function reads out an the number of indexed temperatures available from the + * device's internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a temperature + * feature. Valid IDs can be found with the + * sbapi_get_temperature_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of temperatures available as an unsigned char + */ + DLL_DECL unsigned char sbapi_temperature_count_get(long deviceID, long temperatureFeatureID, int *error_code); + + /** + * This function reads out an indexed temperature from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a temperature + * feature. Valid IDs can be found with the + * sbapi_get_temperature_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param index (Input) An index for the device's temperature sensors + * + * @return the temperature as a double + */ + DLL_DECL double sbapi_temperature_get(long deviceID, long temperatureFeatureID, int *error_code, int index); + + /** + * This function reads out all temperatures from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a temperature + * feature. Valid IDs can be found with the + * sbapi_get_temperature_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) preallocated buffer to store temperatures + * @param max_length (Input) size of preallocated buffer + * + * @return the number of doubles read from the device into the buffer + */ + DLL_DECL int sbapi_temperature_get_all(long deviceID, long temperatureFeatureID, int *error_code, double *buffer, int max_length); + + + +/** + * This function returns the total number of spectrum processing feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_spectrum_processing_features(). + */ + DLL_DECL int + sbapi_get_number_of_spectrum_processing_features( + long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each spectrum processing + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold returned feature handles + * @param max_features (Input) size of preallocated array + * + * @return the number of spectrum processing feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_spectrum_processing_features(long deviceID, int *error_code, + long *spectrumProcessingFeatures, int max_features); + + /** + * This function reads out an the number of scans to average from the + * device's internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrum processing + * feature. Valid IDs can be found with the + * sbapi_get_spectrum_processing_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of scans to average as an unsigned short integer + */ + DLL_DECL unsigned short int sbapi_spectrum_processing_scans_to_average_get(long deviceID, + long spectrumProcessingFeatureID, int *error_code); + + /** + * This function sets the number of scans to average in the the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrum processing + * feature. Valid IDs can be found with the + * sbapi_get_spectrum_processing_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param scansToAverage (Input) The number of spectrum scans used to generate a less + * noisy spectrum due to averaging + * + * @return void + */ + DLL_DECL void sbapi_spectrum_processing_scans_to_average_set(long deviceID, + long spectrumProcessingFeatureID, int *error_code, unsigned short int scansToAverage); + + /** + * This function reads out an the width of the boxcar filter from the + * device's internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrum processing + * feature. Valid IDs can be found with the + * sbapi_get_spectrum_processing_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the width of the boxcar filter an unsigned char (values typically 0-15) + */ + DLL_DECL unsigned char sbapi_spectrum_processing_boxcar_width_get(long deviceID, + long spectrumProcessingFeatureID, int *error_code); + + /** + * This function sets width of the boxcar filter in the the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a spectrum processing + * feature. Valid IDs can be found with the + * sbapi_get_spectrum_processing_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param boxcarWidth (Input) The width of the boxcar smoothing function to be used. + * Values are typically 1 to 15. + * + * @return void + */ + DLL_DECL void sbapi_spectrum_processing_boxcar_width_set(long deviceID, + long spectrumProcessingFeatureID, int *error_code, unsigned char boxcarWidth); + + + +/** + * This function returns the total number of revision feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_revision_features(). + */ + DLL_DECL int + sbapi_get_number_of_revision_features( + long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each revision + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold returned feature handles + * @param max_features (Input) size of preallocated array + * + * @return the number of revision feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_revision_features(long deviceID, int *error_code, + long *revisionFeatures, int max_features); + + /** + * This function reads out the hardware revision from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a temperature + * feature. Valid IDs can be found with the + * sbapi_get_revision_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the hardware revision as one unsigned char byte. (Note that both Ocean View and SpectraSuite display the hex value.) + */ + DLL_DECL unsigned char sbapi_revision_hardware_get(long deviceID, long revisionFeatureID, int *error_code); + + /** + * This function reads out the firmware revision from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a temperature + * feature. Valid IDs can be found with the + * sbapi_get_revision_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the firmware revision as two unsigned short int bytes (Note that both Ocean View and SpectraSuite display the hex value.) + */ + DLL_DECL unsigned short int sbapi_revision_firmware_get(long deviceID, long revisionFeatureID, int *error_code); + +/** + * This function returns the total number of optical bench feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_optical_bench_features(). + */ + DLL_DECL int + sbapi_get_number_of_optical_bench_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each optical bench + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated array to hold returned feature handles + * @param max_features (Input) size of preallocated array + * + * @return the number of optical bench feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_optical_bench_features(long deviceID, int *error_code, long *opticalBenchFeatures, int max_features); + + /** + * This function reads out the optical bench fiber diameter in microns + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a optical + * bench feature. Valid IDs can be found with the + * sbapi_get_optical_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the fiber diameter in microns + */ + DLL_DECL unsigned short int sbapi_optical_bench_get_fiber_diameter_microns(long deviceID, long opticalBenchFeatureID, int *error_code); + + /** + * This function reads out the optical bench slit width in microns + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a optical + * bench feature. Valid IDs can be found with the + * sbapi_get_optical_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the slit width in microns + */ + DLL_DECL unsigned short int sbapi_optical_bench_get_slit_width_microns(long deviceID, long opticalBenchFeatureID, int *error_code); + + /** + * This reads the optical bench ID and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_optical_bench_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_optical_bench_get_id(long deviceID, long featureID, int *error_code, char *buffer, int buffer_length); + + /** + * This reads the optical bench Serial Number and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_optical_bench_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_optical_bench_get_serial_number(long deviceID, long featureID, int *error_code, char *buffer, int buffer_length); + + + /** + * This reads the optical bench Coating and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_optical_bench_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_optical_bench_get_coating(long deviceID, long featureID, int *error_code, char *buffer, int buffer_length); + + /** + * This reads the optical bench filter and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_optical_bench_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_optical_bench_get_filter(long deviceID, long featureID, int *error_code, char *buffer, int buffer_length); + + /** + * This reads the optical bench grating and fills the + * provided array (up to the given length) with it. + * + * @param deviceID (Input) The index of a device previously opened with + * sbapi_open_device(). + * @param opticalBenchFeatureID (Input) The ID of a particular instance of a serial + * number feature. Valid IDs can be found with the + * sbapi_get_optical_bench_features() function. + * @param error_code (Output) pointer to an integer that can be used for + * storing error codes. + * @param buffer (Output) A pre-allocated array of characters that the + * serial number will be copied into + * @param buffer_length (Input) The number of values to copy into the buffer + * (this should be no larger than the number of chars allocated in + * the buffer) + * + * @return the number of bytes written into the buffer + */ + DLL_DECL int + sbapi_optical_bench_get_grating(long deviceID, long featureID, int *error_code, char *buffer, int buffer_length); + + + /** + * This function returns the total number of stray light coefficient feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_stray_light_coeffs_features(). + */ + DLL_DECL int + sbapi_get_number_of_stray_light_coeffs_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each stray light coefficient + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated buffer to hold returned feature handles + * @param max_features (Input) size of preallocated buffer + * + * @return the number of stray light coefficient feature IDs that were copied. + */ + DLL_DECL int + sbapi_get_stray_light_coeffs_features(long deviceID, int *error_code, + long *features, int max_features); + + /** + * This function reads out stray light coefficients from the device's + * internal memory if that feature is supported. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a stray light coefficient + * feature. Valid IDs can be found with the + * sbapi_get_stray_light_coeffs_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param buffer (Output) preallocated buffer to store stray light coefficients + * @param max_length (Input) size of preallocated buffer + * + * @return the number of doubles read from the device into the buffer + */ + DLL_DECL int sbapi_stray_light_coeffs_get(long deviceID, long featureID, + int *error_code, double *buffer, int max_length); + + + /** + * This function returns the total number of data buffer feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_data_buffer_features(). + */ + DLL_DECL int sbapi_get_number_of_data_buffer_features(long deviceID, int *error_code); + + /** + * This function returns IDs for accessing each data buffer + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated buffer to hold returned feature handles + * @param max_features (Input) size of preallocated buffer + * + * @return the number of data buffer feature IDs that were copied. + */ + DLL_DECL int sbapi_get_data_buffer_features(long deviceID, int *error_code, + long *buffer, unsigned int maxLength); + + /** + * @brief Clear the data buffer + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + */ + DLL_DECL void sbapi_data_buffer_clear(long deviceID, long featureID, int *error_code); + + /** + * @brief Get the number of data elements currently in the buffer + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return A count of how many items are available for retrieval from the buffer + */ + DLL_DECL unsigned long sbapi_data_buffer_get_number_of_elements(long deviceID, + long featureID, int *error_code); + + /** + * @brief Get the present limit of how many data elements will be retained by the buffer. + * This value can be changed with sbapi_data_buffer_set_buffer_capacity(). + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return A count of how many items the buffer will store before data may be lost + */ + DLL_DECL unsigned long sbapi_data_buffer_get_buffer_capacity(long deviceID, + long featureID, int *error_code); + + /** + * @brief Get the maximum possible configurable size for the data buffer + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The largest value that may be set with sbapi_data_buffer_set_buffer_capacity(). + */ + DLL_DECL unsigned long sbapi_data_buffer_get_buffer_capacity_maximum( + long deviceID, long featureID, int *error_code); + + /** + * @brief Get the minimum possible configurable size for the data buffer + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The smallest value that may be set with sbapi_data_buffer_set_buffer_capacity(). + */ + DLL_DECL unsigned long sbapi_data_buffer_get_buffer_capacity_minimum( + long deviceID, long featureID, int *error_code); + + /** + * @brief Set the number of data elements that the buffer should retain + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param capacity (Input) Limit on the number of data elements to store. This is + * bounded by what is returned by sbapi_data_buffer_get_buffer_capacity_minimum() and + * sbapi_data_buffer_get_buffer_capacity_maximum(). + */ + DLL_DECL void sbapi_data_buffer_set_buffer_capacity(long deviceID, + long featureID, int *error_code, unsigned long capacity); + + /** + * This function returns the total number of acquisition delay feature + * instances available in the indicated device. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * + * @return the number of features that will be returned by a call to + * sbapi_get_data_buffer_features(). + */ + DLL_DECL int sbapi_get_number_of_acquisition_delay_features(long deviceID, int *errorCode); + + /** + * This function returns IDs for accessing each data buffer + * feature instance for this device. The IDs are only valid when used with + * the deviceID used to obtain them. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param features (Output) preallocated buffer to hold returned feature handles + * @param max_features (Input) size of preallocated buffer + * + * @return the number of data buffer feature IDs that were copied. + */ + DLL_DECL int sbapi_get_acquisition_delay_features(long deviceID, int *errorCode, + long *buffer, unsigned int maxLength); + + /** + * Set the acquisition delay in microseconds. This may also be referred to as the + * trigger delay. In any event, it is the time between some event (such as a request + * for data, or an external trigger pulse) and when data acquisition begins. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @param delay_usec (Input) The new delay to use in microseconds + */ + DLL_DECL void sbapi_acquisition_delay_set_delay_microseconds(long deviceID, long featureID, + int *errorCode, unsigned long delay_usec); + + /** + * Get the acquisition delay in microseconds. This may also be referred to as the + * trigger delay. In any event, it is the time between some event (such as a request + * for data, or an external trigger pulse) and when data acquisition begins. + * + * Note that not all devices support reading this value back. In these cases, the + * returned value will be the last value sent to sbapi_acquisition_delay_set_delay_microseconds(). + * If no value has been set and the value cannot be read back, this function will + * indicate an error. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The acquisition delay in microseconds + */ + DLL_DECL unsigned long sbapi_acquisition_delay_get_delay_microseconds(long deviceID, + long featureID, int *errorCode); + + /** + * Get the allowed step size for the acquisition delay in microseconds. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The acquisition delay step size in microseconds + */ + DLL_DECL unsigned long sbapi_acquisition_delay_get_delay_increment_microseconds(long deviceID, + long featureID, int *errorCode); + + /** + * Get the maximum allowed acquisition delay in microseconds. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The maximum acquisition delay in microseconds + */ + DLL_DECL unsigned long sbapi_acquisition_delay_get_delay_maximum_microseconds(long deviceID, + long featureID, int *errorCode); + + /** + * Get the minimum allowed acquisition delay in microseconds. + * + * @param deviceID (Input) The index of a device previously opened with sbapi_open_device(). + * @param featureID (Input) The ID of a particular instance of a data buffer + * feature. Valid IDs can be found with the + * sbapi_get_data_buffer_features() function. + * @param error_code (Output) A pointer to an integer that can be used for storing + * error codes. + * @return The minimum acquisition delay in microseconds + */ + DLL_DECL unsigned long sbapi_acquisition_delay_get_delay_minimum_microseconds(long deviceID, + long featureID, int *errorCode); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* SEABREEZEAPI_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPIConstants.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPIConstants.h new file mode 100644 index 0000000..f5abf42 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SeaBreezeAPIConstants.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file SeaBreezeAPIConstants.h + * @date January 2015 + * @author Ocean Optics, Inc. + * + * This file defines constants for use with SeaBreeze API + * implementations. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SEABREEZEAPICONSTANTS_H +#define SEABREEZEAPICONSTANTS_H + +/* Macros and constants */ +#define SET_ERROR_CODE(code) do { if(NULL != errorCode) { *errorCode = code; } } while(0) + +#ifdef ERROR_SUCCESS +#undef ERROR_SUCCESS +#endif + +/* Constants */ +#define ERROR_SUCCESS 0 +#define ERROR_INVALID_ERROR 1 +#define ERROR_NO_DEVICE 2 +#define ERROR_FAILED_TO_CLOSE 3 +#define ERROR_NOT_IMPLEMENTED 4 +#define ERROR_FEATURE_NOT_FOUND 5 +#define ERROR_TRANSFER_ERROR 6 +#define ERROR_BAD_USER_BUFFER 7 +#define ERROR_INPUT_OUT_OF_BOUNDS 8 +#define ERROR_SPECTROMETER_SATURATED 9 +#define ERROR_VALUE_NOT_FOUND 10 + +#endif /* SEABREEZEAPICONSTANTS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SerialNumberFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SerialNumberFeatureAdapter.h new file mode 100644 index 0000000..eb8d2c8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SerialNumberFeatureAdapter.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file SerialNumberFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze SerialNumberFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_SERIALNUMBERFEATUREADAPTER_H +#define SEABREEZE_SERIALNUMBERFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class SerialNumberFeatureAdapter + : public FeatureAdapterTemplate { + public: + SerialNumberFeatureAdapter(SerialNumberFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~SerialNumberFeatureAdapter(); + + int getSerialNumber(int *errorCode, char *buffer, int buffer_length); + unsigned char getSerialNumberMaximumLength(int *errorCode); + + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ShutterFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ShutterFeatureAdapter.h new file mode 100644 index 0000000..cf3a65d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ShutterFeatureAdapter.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file ShutterFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze ShutterFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_SHUTTERFEATUREADAPTER_H +#define SEABREEZE_SHUTTERFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/shutter/ShutterFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class ShutterFeatureAdapter + : public FeatureAdapterTemplate { + public: + ShutterFeatureAdapter(ShutterFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~ShutterFeatureAdapter(); + + void setShutterOpen(int *errorCode, bool open); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrometerFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrometerFeatureAdapter.h new file mode 100644 index 0000000..2ec42b4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrometerFeatureAdapter.h @@ -0,0 +1,74 @@ +/***************************************************//** + * @file SpectrometerFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze OOISpectrometerFeature instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_SPECTROMETER_FEATURE_ADAPTER_H +#define SEABREEZE_SPECTROMETER_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class SpectrometerFeatureAdapter : public FeatureAdapterTemplate { + public: + SpectrometerFeatureAdapter( + OOISpectrometerFeatureInterface *spec, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~SpectrometerFeatureAdapter(); + + /* Spectrometer commands */ + int getUnformattedSpectrum(int *errorCode, + unsigned char *buffer, int bufferLength); + int getFormattedSpectrum(int *errorCode, + double* buffer, int bufferLength); + int getUnformattedSpectrumLength(int *errorCode); + int getFormattedSpectrumLength(int *errorCode); + void setTriggerMode(int *errorCode, int mode); + int getWavelengths(int *errorCode, double *wavelengths, int length); + int getElectricDarkPixelCount(int *errorCode); + int getElectricDarkPixelIndices(int *errorCode, + int *indices, int length); + void setIntegrationTimeMicros(int *errorCode, + unsigned long integrationTimeMicros); + long getMinimumIntegrationTimeMicros(int *errorCode); + long getMaximumIntegrationTimeMicros(int *errorCode); + double getMaximumIntensity(int *errorCode); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrumProcessingFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrumProcessingFeatureAdapter.h new file mode 100644 index 0000000..6ed2264 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/SpectrumProcessingFeatureAdapter.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file SpectrumProcessingFeatureAdapter.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a wrapper that allows + * access to SeaBreeze SpectrumProcessingFeatureInterface instances. + * + * 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_SPECTRUMPROCESSINGFEATUREADAPTER_H +#define SEABREEZE_SPECTRUMPROCESSINGFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class SpectrumProcessingFeatureAdapter + : public FeatureAdapterTemplate { + public: + SpectrumProcessingFeatureAdapter(SpectrumProcessingFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~SpectrumProcessingFeatureAdapter(); + + unsigned char readSpectrumProcessingBoxcarWidth(int *errorCode); + unsigned short int readSpectrumProcessingScansToAverage(int *errorCode); + void writeSpectrumProcessingBoxcarWidth(int *errorCode, unsigned char boxcarWidth); + void writeSpectrumProcessingScansToAverage(int *errorCode, unsigned short int scansToAverage); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrayLightCoeffsFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrayLightCoeffsFeatureAdapter.h new file mode 100644 index 0000000..54d208b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrayLightCoeffsFeatureAdapter.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file StrayLightCoeffsFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze StrayLightCoeffFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_STRAYLIGHTCOEFFSFEATUREADAPTER_H +#define SEABREEZE_STRAYLIGHTCOEFFSFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class StrayLightCoeffsFeatureAdapter + : public FeatureAdapterTemplate { + public: + StrayLightCoeffsFeatureAdapter(StrayLightCoeffsFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~StrayLightCoeffsFeatureAdapter(); + + int readStrayLightCoeffs(int *errorCode, double *buffer, + int bufferLength); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrobeLampFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrobeLampFeatureAdapter.h new file mode 100644 index 0000000..e5bd4a0 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/StrobeLampFeatureAdapter.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file StrobeLampFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows + * access to SeaBreeze StrobeLampFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_STROBELAMPFEATUREADAPTER_H +#define SEABREEZE_STROBELAMPFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/light_source/StrobeLampFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class StrobeLampFeatureAdapter + : public FeatureAdapterTemplate { + public: + StrobeLampFeatureAdapter(StrobeLampFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~StrobeLampFeatureAdapter(); + + void setStrobeLampEnable(int *errorCode, bool enable); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/TemperatureFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/TemperatureFeatureAdapter.h new file mode 100644 index 0000000..7ff3fd0 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/TemperatureFeatureAdapter.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file TemperatureFeatureAdapter.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a wrapper that allows + * access to SeaBreeze TemperatureFeatureInterface instances. + * + * 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_TEMPERATUREFEATUREADAPTER_H +#define SEABREEZE_TEMPERATUREFEATUREADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/temperature/TemperatureFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class TemperatureFeatureAdapter + : public FeatureAdapterTemplate { + public: + TemperatureFeatureAdapter(TemperatureFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~TemperatureFeatureAdapter(); + + unsigned char readTemperatureCount(int *errorCode); + double readTemperature(int *errorCode, int index); + int readAllTemperatures(int *errorCode, double *buffer, int bufferLength); + }; + + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ThermoElectricCoolerFeatureAdapter.h b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ThermoElectricCoolerFeatureAdapter.h new file mode 100644 index 0000000..46813e1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/api/seabreezeapi/ThermoElectricCoolerFeatureAdapter.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file ThermoElectricCoolerFeatureAdapter.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a wrapper that allows access to SeaBreeze + * TECFeatureInterface instances. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_THERMO_ELECTRIC_COOLER_FEATURE_ADAPTER_H +#define SEABREEZE_THERMO_ELECTRIC_COOLER_FEATURE_ADAPTER_H + +#include "api/seabreezeapi/FeatureAdapterTemplate.h" +#include "vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureInterface.h" + +namespace seabreeze { + namespace api { + + class ThermoElectricCoolerFeatureAdapter + : public FeatureAdapterTemplate { + public: + ThermoElectricCoolerFeatureAdapter(ThermoElectricFeatureInterface *intf, + const FeatureFamily &f, + Protocol *p, Bus *b, unsigned short instanceIndex); + virtual ~ThermoElectricCoolerFeatureAdapter(); + + /* Thermoelectric cooler functions */ + double readTECTemperature(int *errorCode); + void setTECTemperature(int *errorCode, + double temperature_degrees_celsius); + void setTECEnable(int *errorCode, bool tecEnable); + void setTECFanEnable(int *errorCode, bool tecFanEnable); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/ByteVector.h b/othersoft/shuttercali/source/OSIF/include/common/ByteVector.h new file mode 100644 index 0000000..8c168ca --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/ByteVector.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file ByteVector.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_BYTEVECTOR_H +#define SEABREEZE_BYTEVECTOR_H + +#include "common/SeaBreeze.h" +#include "common/Data.h" +#include + +namespace seabreeze { + + class ByteVector : public Data { + public: + ByteVector(); + /* Constructor that makes a copy of the given vector for internal use */ + ByteVector(const std::vector &that); + virtual ~ByteVector(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + + /* Get the data associated with this instance */ + std::vector &getByteVector(); + + private: + std::vector *data; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/Data.h b/othersoft/shuttercali/source/OSIF/include/common/Data.h new file mode 100644 index 0000000..ed23c67 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/Data.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file Data.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a sort of a wrapper class that can encapsulate + * different kinds of data that may be returned as the + * result of a protocol transfer. The idea is that the + * data being passed back up from the device probably needs + * to be in some specific form, but we need to be able + * to convert it to whatever the receiver can use. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_DATA_H +#define SEABREEZE_DATA_H + +#include "common/SeaBreeze.h" +#include "common/UnitDescriptor.h" +#include + +namespace seabreeze { + + class Data { + public: + Data(); + virtual ~Data(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/DoubleVector.h b/othersoft/shuttercali/source/OSIF/include/common/DoubleVector.h new file mode 100644 index 0000000..50c6d35 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/DoubleVector.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file DoubleVector.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_DOUBLEVECTOR_H +#define SEABREEZE_DOUBLEVECTOR_H + +#include +#include "common/SeaBreeze.h" +#include "common/Data.h" + +namespace seabreeze { + + class DoubleVector : public Data { + public: + DoubleVector(); + DoubleVector(const std::vector &that); + virtual ~DoubleVector(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + + /* Get the data associated with this instance */ + std::vector &getDoubleVector(); + + private: + std::vector *data; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/FloatVector.h b/othersoft/shuttercali/source/OSIF/include/common/FloatVector.h new file mode 100644 index 0000000..69b6cb9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/FloatVector.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file FloatVector.h + * @date March 2010 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FLOATVECTOR_H +#define SEABREEZE_FLOATVECTOR_H + +#include +#include "common/SeaBreeze.h" +#include "common/Data.h" + +namespace seabreeze { + + class FloatVector : public Data { + public: + FloatVector(); + FloatVector(const std::vector &that); + virtual ~FloatVector(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + + /* Get the data associated with this instance */ + std::vector &getFloatVector(); + + private: + std::vector *data; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/Log.h b/othersoft/shuttercali/source/OSIF/include/common/Log.h new file mode 100644 index 0000000..242f8aa --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/Log.h @@ -0,0 +1,132 @@ +/** + @file Log.h + @brief Interface to Log + @author Mark Zieg + + LICENSE: + + SeaBreeze Copyright (C) 2014, 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_LOG_H +#define SEABREEZE_LOG_H + +#include "api/DllDecl.h" + +#include +#include +#include +#include + +#ifdef OOI_DEBUG + #define OOI_LOG_PRINT 1 +#else + #define OOI_LOG_PRINT 0 +#endif + +#ifdef __cplusplus + +/** +* @brief instantiate logger in the current function +* @param s (Input) function name (typically __FUNCTION__) +*/ +#define LOG(s) Log logger(s); + +/** +* @brief log a printf string (and optional arguments) if debugging is enabled +* @note double parens: call as LOG_DEBUG(("variable x is %d, y is %f", x, y)); +* @see http://stackoverflow.com/questions/1644868/c-define-macro-for-debug-printing +*/ +#define LOG_DEBUG(s) do { if (OOI_LOG_PRINT) logger.debug s; } while (0) + +//! @see LOG_DEBUG +#define LOG_INFO(s) do { if (OOI_LOG_PRINT) logger.info s; } while (0) + +//! @see LOG_DEBUG +#define LOG_WARN(s) do { if (OOI_LOG_PRINT) logger.warn s; } while (0) + +//! @see LOG_DEBUG +#define LOG_ERROR(s) do { if (OOI_LOG_PRINT) logger.error s; } while (0) + +#define OOI_LOG_LEVEL_NEVER 0 +#define OOI_LOG_LEVEL_ERROR 1 +#define OOI_LOG_LEVEL_WARN 2 +#define OOI_LOG_LEVEL_INFO 3 +#define OOI_LOG_LEVEL_DEBUG 4 +#define OOI_LOG_LEVEL_TRACE 5 + +/** +* @brief Simple logger for OOI applications. +* @todo Provide better thread support (hard to tell what thread model +* the caller may be using...) +* @todo Provide flat C interface (e.g. for NativeUSBWinUSB.c, test apps) +* +* Provides automatic heirarchical call-stack indentation. +*/ +class DLL_DECL Log +{ + public: + Log(const char *s); + ~Log(); + + // public class methods + static void setLogLevel(int lvl); + static void setLogLevel(const std::string& s); + static void setLogFile(void *f); + + // public instance methods + void debug(const char *fmt, ...); + void info (const char *fmt, ...); + void warn (const char *fmt, ...); + void error(const char *fmt, ...); + + // these must be public for C interface to work + static unsigned logLevel; + void formatAndSend(int lvl, const char *lvlName, + const char *separator, const char *fmt, va_list args); + + private: + // private class attributes + static FILE *logFile; + static std::stack* callstack; + + // private instance methods + void trace(const char *fmt, ...); +}; + +extern "C" { +#endif /* __cplusplus */ + +// We need the flattened C interface if we want to call from Cygwin (mainly +// to set log level)...see http://cygwin.com/ml/cygwin/2006-04/msg00251.html +void DLL_DECL seabreeze_log_set_level_int(int lvl); +void DLL_DECL seabreeze_log_set_level_string(const char *s); +void DLL_DECL seabreeze_log_debug(const char *fmt, ...); +void DLL_DECL seabreeze_log_info (const char *fmt, ...); +void DLL_DECL seabreeze_log_warn (const char *fmt, ...); +void DLL_DECL seabreeze_log_error(const char *fmt, ...); + +#ifdef __cplusplus +}; + +#endif /* __cplusplus */ +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/SeaBreeze.h b/othersoft/shuttercali/source/OSIF/include/common/SeaBreeze.h new file mode 100644 index 0000000..aaa1c5e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/SeaBreeze.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file SeaBreeze.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This provides some project-wide constants and definitions. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_H +#define SEABREEZE_H + +typedef unsigned char byte; + +#ifdef WINDOWS +/* Visual studio does not implement declared exception + * specification but accepts it with a warning. This + * suppresses the warning (4290). + */ +#pragma warning( disable : 4290 ) +#endif /* WINDOWS */ + +#endif /* SEABREEZE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/U32Vector.h b/othersoft/shuttercali/source/OSIF/include/common/U32Vector.h new file mode 100644 index 0000000..93785b4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/U32Vector.h @@ -0,0 +1,77 @@ +/***************************************************//** + * @file U32Vector.h + * @date September 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_U32VECTOR_H +#define SEABREEZE_U32VECTOR_H + +#include +#include "common/SeaBreeze.h" +#include "common/Data.h" + +/* This class requires a 32-bit integer type. This will need a little help + * to know what the target machine is, so this tries to work it out. + */ +#ifdef _MSC_VER +/* Visual Studio */ +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +#else +/* C99 compatible */ +#include +#endif + + +namespace seabreeze { + + class U32Vector : public Data { + public: + U32Vector(); + /* Constructor that makes a copy of the given vector for internal use */ + U32Vector(const std::vector &that); + U32Vector(unsigned int length); + virtual ~U32Vector(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + + /* Get the data associated with this instance */ + std::vector &getU32Vector(); + + private: + std::vector *data; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/UShortVector.h b/othersoft/shuttercali/source/OSIF/include/common/UShortVector.h new file mode 100644 index 0000000..7606375 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/UShortVector.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file UShortVector.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_USHORTVECTOR_H +#define SEABREEZE_USHORTVECTOR_H + +#include +#include "common/SeaBreeze.h" +#include "common/Data.h" + +namespace seabreeze { + + class UShortVector : public Data { + public: + UShortVector(); + /* Constructor that makes a copy of the given vector for internal use */ + UShortVector(const std::vector &that); + UShortVector(unsigned int length); + virtual ~UShortVector(); + /* Dimensionality of data. 0 for scalar, 1 for vector, + * 2 for a pair of related vectors (e.g. [X, Y] or matrix), + * 3 for 3D, etc. + */ + virtual int getNumberOfDimensions(); + + /* Get all of the unit descriptors associated with this Data. */ + virtual std::vector *getUnits(); + + /* Get the data associated with this instance */ + std::vector &getUShortVector(); + + private: + std::vector *data; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/UnitDescriptor.h b/othersoft/shuttercali/source/OSIF/include/common/UnitDescriptor.h new file mode 100644 index 0000000..3a5c737 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/UnitDescriptor.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file UnitDescriptor.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_UNITDESCRIPTOR_H +#define SEABREEZE_UNITDESCRIPTOR_H + +namespace seabreeze { + + class UnitDescriptor { + public: + UnitDescriptor(); + ~UnitDescriptor(); + + /* FIXME: need to define unit property getters */ + + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/Bus.h b/othersoft/shuttercali/source/OSIF/include/common/buses/Bus.h new file mode 100644 index 0000000..491604c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/Bus.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file Bus.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This provides a base class for all sorts of buses. A bus + * is a mechanism for transferring a stream of data from one + * point to another. The bus does not concern itself with the + * contents of the data stream. At most, it may use hints to + * determine how a particular message will be moved if this + * is necessary to complete the operation. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_BUS_H +#define SEABREEZE_BUS_H + +#include "common/protocols/ProtocolHint.h" +#include "common/buses/TransferHelper.h" +#include "common/buses/BusFamily.h" +#include "common/buses/DeviceLocatorInterface.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class Bus { + public: + Bus(); + virtual ~Bus(); + virtual TransferHelper *getHelper(const std::vector &hints) const = 0; + virtual BusFamily getBusFamily() const = 0; + /* Associate this Bus instance with a particular device location. + * This MUST be done before open or close can be used. + */ + virtual void setLocation(const DeviceLocatorInterface &location) + throw (IllegalArgumentException) = 0; + virtual bool open() = 0; + virtual void close() = 0; + virtual DeviceLocatorInterface *getLocation() = 0; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamilies.h b/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamilies.h new file mode 100644 index 0000000..7b77043 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamilies.h @@ -0,0 +1,86 @@ +/***************************************************//** + * @file BusFamilies.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This provides a way to get references to different kinds of buses + * (e.g. USB, Ethernet, serial) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 BUSFAMILIES_H +#define BUSFAMILIES_H + +#include "common/buses/BusFamily.h" +#include + +namespace seabreeze { + + class USBBusFamily : public BusFamily { + public: + USBBusFamily(); + virtual ~USBBusFamily(); + }; + + class EthernetBusFamily : public BusFamily { + public: + EthernetBusFamily(); + virtual ~EthernetBusFamily(); + }; + + class RS232BusFamily : public BusFamily { + public: + RS232BusFamily(); + virtual ~RS232BusFamily(); + }; + + class TCPIPv4BusFamily : public BusFamily { + public: + TCPIPv4BusFamily(); + virtual ~TCPIPv4BusFamily(); + }; + + class UDPIPv4BusFamily : public BusFamily { + public: + UDPIPv4BusFamily(); + virtual ~UDPIPv4BusFamily(); + }; + + class BusFamilies { + public: + const USBBusFamily USB; + const EthernetBusFamily ETHERNET; + const RS232BusFamily RS232; + const TCPIPv4BusFamily TCPIPv4; + const UDPIPv4BusFamily UDPIPv4; + + BusFamilies(); + ~BusFamilies(); + std::vector getAllBusFamilies(); + }; + +} + +#endif /* BUSFAMILIES_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamily.h b/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamily.h new file mode 100644 index 0000000..d1dbb97 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/BusFamily.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file BusFamily.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This provides a way to describe different kinds of buses + * (e.g. USB, Ethernet, serial) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 BUSFAMILY_H +#define BUSFAMILY_H + +#include + +namespace seabreeze { + class BusFamily { + public: + virtual ~BusFamily(); + virtual std::string getName() const; + virtual bool equals(const BusFamily &that); + + protected: + BusFamily(std::string name, int id); + + private: + std::string busName; + int type; + }; + +} + +#endif /* BUSFAMILY_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocationProberInterface.h b/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocationProberInterface.h new file mode 100644 index 0000000..3cf63e1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocationProberInterface.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file DeviceLocationProberInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * DeviceLocatorInterface provides a base interface for + * classes that allow the location of a device to be + * probed in a bus-specific way. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 DEVICELOCATIONPROBERINTERFACE_H +#define DEVICELOCATIONPROBERINTERFACE_H + +#include +#include "common/buses/DeviceLocatorInterface.h" + +namespace seabreeze { + + class DeviceLocationProberInterface { + public: + virtual ~DeviceLocationProberInterface() = 0; + + /* Report how many devices of this type are available */ + virtual std::vector *probeDevices() = 0; + + protected: + DeviceLocationProberInterface(); + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline DeviceLocationProberInterface::~DeviceLocationProberInterface() {} + +} + +#endif /* DEVICELOCATIONPROBERINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocatorInterface.h b/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocatorInterface.h new file mode 100644 index 0000000..caccd5f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/DeviceLocatorInterface.h @@ -0,0 +1,82 @@ +/***************************************************//** + * @file DeviceLocatorInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * DeviceLocatorInterface provides a base interface for + * classes that allow the location of a device to be + * specified in a bus-specific way. For instance, a + * USB DeviceLocator might include a device path or + * index, and a socket DeviceLocator might include an + * IP address and port number. This allows + * devices that cannot be identified by probing to still + * be found easily. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 DEVICELOCATORINTERFACE_H +#define DEVICELOCATORINTERFACE_H + +#include +#include "common/buses/BusFamily.h" + +namespace seabreeze { + + class DeviceLocatorInterface { + public: + virtual ~DeviceLocatorInterface() = 0; + + /** + * Get a unique identifier for this location. This can be any value + * as long as it is globally unique. + */ + virtual unsigned long getUniqueLocation() const = 0; + + /** + * Determine whether this DeviceLocator refers to the same device + * as another. + */ + virtual bool equals(DeviceLocatorInterface &that) = 0; + + /** + * Get a human-readable string that describes the location + */ + virtual std::string getDescription() = 0; + + /** + * Get a description of the type of bus that the device is associated with + */ + virtual BusFamily getBusFamily() const = 0; + + /* Get an exact copy of this instance */ + virtual DeviceLocatorInterface *clone() const = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline DeviceLocatorInterface::~DeviceLocatorInterface() {} + +} + +#endif /* DEVICELOCATORINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/TransferHelper.h b/othersoft/shuttercali/source/OSIF/include/common/buses/TransferHelper.h new file mode 100644 index 0000000..8d7988e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/TransferHelper.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file TransferHelper.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is effectively an interface for wrappers around bus + * activity. These wrappers may be selected from a Bus + * based on certain hints provided by a Protocol or its + * various Exchanges. All that this specifies is that a + * given object must be able to send() and receive() data + * across its particular (encapsulated) Bus. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TRANSFERHELPER_H +#define SEABREEZE_TRANSFERHELPER_H + +#include "common/SeaBreeze.h" +#include "common/exceptions/BusTransferException.h" +#include + +namespace seabreeze { + + class TransferHelper { + public: + TransferHelper(); + virtual ~TransferHelper(); + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException) = 0; + virtual int send(const std::vector &buffer, unsigned int length) const + throw (BusTransferException) = 0; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4NetworkProtocol.h b/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4NetworkProtocol.h new file mode 100644 index 0000000..d07309d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4NetworkProtocol.h @@ -0,0 +1,75 @@ +/***************************************************//** + * @file IPv4NetworkProtocol.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_IPV4NETWORKPROTOCOL_H +#define SEABREEZE_IPV4NETWORKPROTOCOL_H + +#include +#include + +namespace seabreeze { + class IPv4NetworkProtocol { + public: + virtual ~IPv4NetworkProtocol(); + virtual std::string getName() const; + virtual bool equals(const IPv4NetworkProtocol &that) const; + + protected: + IPv4NetworkProtocol(std::string name, int id); + + private: + std::string protocolName; + int type; + }; + + class TCP_IPv4 : public IPv4NetworkProtocol { + public: + TCP_IPv4(); + virtual ~TCP_IPv4(); + }; + + class UDP_IPv4 : public IPv4NetworkProtocol { + public: + UDP_IPv4(); + virtual ~UDP_IPv4(); + }; + + class IPv4NetworkProtocols { + public: + const TCP_IPv4 TCP_IP4; + const UDP_IPv4 UDP_IP4; + + IPv4NetworkProtocols(); + ~IPv4NetworkProtocols(); + std::vector getAllIPv4NetworkProtocols(); + }; +} + +#endif /* SEABREEZE_IPV4NETWORKPROTOCOL_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4SocketDeviceLocator.h b/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4SocketDeviceLocator.h new file mode 100644 index 0000000..056fc90 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/network/IPv4SocketDeviceLocator.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file IPv4SocketDeviceLocator.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_IPV4SOCKETDEVICELOCATOR_H +#define SEABREEZE_IPV4SOCKETDEVICELOCATOR_H + +#include "common/buses/DeviceLocatorInterface.h" +#include "common/buses/network/IPv4NetworkProtocol.h" +#include + +namespace seabreeze { + class IPv4SocketDeviceLocator : public DeviceLocatorInterface { + public: + IPv4SocketDeviceLocator(const IPv4NetworkProtocol &proto, std::string ip, + int portNumber); + virtual ~IPv4SocketDeviceLocator(); + + std::string getIPv4Address(); + int getPort(); + IPv4NetworkProtocol getIPv4NetworkProtocol(); + + /* Inherited from DeviceLocatorInterface */ + virtual unsigned long getUniqueLocation() const; + virtual bool equals(DeviceLocatorInterface &that); + virtual std::string getDescription(); + virtual BusFamily getBusFamily() const; + virtual DeviceLocatorInterface *clone() const; + + protected: + unsigned long computeLocationHash(); + + IPv4NetworkProtocol protocol; + std::string ipAddr; + int port; + unsigned long locationHash; + }; +} + +#endif /* SEABREEZE_IPV4SOCKETDEVICELOCATOR_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketBus.h b/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketBus.h new file mode 100644 index 0000000..47dee40 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketBus.h @@ -0,0 +1,75 @@ +/***************************************************//** + * @file TCPIPv4SocketBus.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_TCPIPV4SOCKETBUS_H +#define SEABREEZE_TCPIPV4SOCKETBUS_H + +#include "common/buses/Bus.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "native/network/Socket.h" +#include + +namespace seabreeze { + class TCPIPv4SocketBus : public Bus { + public: + TCPIPv4SocketBus(); + virtual ~TCPIPv4SocketBus(); + + virtual Socket *getSocketDescriptor(); + + virtual BusFamily getBusFamily() const; + + virtual void setLocation(const DeviceLocatorInterface &location) + throw (IllegalArgumentException); + virtual DeviceLocatorInterface *getLocation(); + virtual TransferHelper *getHelper( + const std::vector &hints) const; + + /* Pure virtual methods */ + virtual bool open() = 0; + virtual void close() = 0; + + + protected: + void addHelper(ProtocolHint *hint, TransferHelper *helper); + void clearHelpers(); + + Socket *socket; + DeviceLocatorInterface *deviceLocator; + + /* These vectors should really be in a map, but that didn't want to + * work easily. Since there will likely be about 2 entries in here, + * storing in a pair of vectors for now won't hurt anything. + */ + std::vector helperKeys; + std::vector helperValues; + }; +} + +#endif /* SEABREEZE_TCPIPV4SOCKETBUS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketTransferHelper.h new file mode 100644 index 0000000..d7e4b69 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/network/TCPIPv4SocketTransferHelper.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file TCPIPv4SocketTransferHelper.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_TCPIPV4SOCKETTRANSFERHELPER_H +#define SEABREEZE_TCPIPV4SOCKETTRANSFERHELPER_H + +#include "common/buses/TransferHelper.h" +#include "native/network/Socket.h" + +namespace seabreeze { + class TCPIPv4SocketTransferHelper : public TransferHelper { + public: + TCPIPv4SocketTransferHelper(Socket *sock); + virtual ~TCPIPv4SocketTransferHelper(); + + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException); + virtual int send(const std::vector &buffer, unsigned int length) const + throw (BusTransferException); + + protected: + Socket *socket; + }; +} + +#endif /* SEABREEZE_TCPIPV4SOCKETTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232DeviceLocator.h b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232DeviceLocator.h new file mode 100644 index 0000000..1c8c20c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232DeviceLocator.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file RS232DeviceLocator.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This class encapsulates the information needed to open + * a device on an RS232 bus. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 RS232DEVICELOCATOR_H +#define RS232DEVICELOCATOR_H + +#include "common/buses/DeviceLocatorInterface.h" +#include + +namespace seabreeze { + + class RS232DeviceLocator : public DeviceLocatorInterface { + public: + RS232DeviceLocator(std::string devicePath, int baudRate); + virtual ~RS232DeviceLocator(); + + std::string &getDevicePath(); + int getBaudRate(); + + /* Inherited from DeviceLocatorInterface */ + virtual unsigned long getUniqueLocation() const; + virtual bool equals(DeviceLocatorInterface &that); + virtual std::string getDescription(); + virtual BusFamily getBusFamily() const; + virtual DeviceLocatorInterface *clone() const; + + private: + void computeLocationHash(); + std::string devicePath; + int baudRate; + unsigned long locationHash; + }; + +} + +#endif /* RS232DEVICELOCATOR_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232Interface.h b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232Interface.h new file mode 100644 index 0000000..fad0b1e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232Interface.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file RS232Interface.h + * @date April 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 RS232INTERFACE_H +#define RS232INTERFACE_H + +#include "common/buses/Bus.h" +#include "native/rs232/NativeRS232.h" +#include "native/rs232/RS232.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class RS232Interface : public Bus { + public: + RS232Interface(); + virtual ~RS232Interface(); + virtual RS232 *getRS232Descriptor(); + virtual DeviceLocatorInterface *getLocation(); + virtual void setLocation(const DeviceLocatorInterface &location) + throw (IllegalArgumentException); + virtual BusFamily getBusFamily() const; + + /* Pure virtual methods */ + virtual TransferHelper *getHelper( + const std::vector &hints) const = 0; + virtual bool open() = 0; + virtual void close() = 0; + + protected: + RS232 *rs232; + DeviceLocatorInterface *deviceLocator; + }; + +} + +#endif /* RS232INTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232TransferHelper.h b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232TransferHelper.h new file mode 100644 index 0000000..e912f95 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/rs232/RS232TransferHelper.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file RS232TransferHelper.h + * @date April 2011 + * @author Ocean Optics, Inc. + * + * This provides an abstraction around the RS232 bus. + * RS232 is pretty simple once the port is opened and + * configured, so this mostly just takes care of ensuring + * that all bytes are sent and received as required. + * + * This will effectively block on reads and writes until + * they are complete. A non-blocking transfer helper + * could be created to complement this if there was + * some need, but it is not clear who would be responsible + * for delayed reads or retransmits. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 RS232TRANSFERHELPER_H +#define RS232TRANSFERHELPER_H + +#include "common/buses/TransferHelper.h" +#include "native/rs232/RS232.h" + +namespace seabreeze { + + class RS232TransferHelper : public TransferHelper { + public: + RS232TransferHelper(RS232 *rs232Descriptor); + virtual ~RS232TransferHelper(); + + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException); + virtual int send(const std::vector &buffer, unsigned int length) const + throw (BusTransferException); + + protected: + RS232 *rs232; + }; + +} + +#endif /* USBTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBDeviceLocator.h b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBDeviceLocator.h new file mode 100644 index 0000000..ea9f1d2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBDeviceLocator.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file USBDeviceLocator.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This class encapsulates the information needed to open + * a device on a USB bus. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USBDEVICELOCATOR_H +#define USBDEVICELOCATOR_H + +#include "common/buses/DeviceLocatorInterface.h" +#include + +namespace seabreeze { + + class USBDeviceLocator : public DeviceLocatorInterface { + public: + USBDeviceLocator(unsigned long ID); + virtual ~USBDeviceLocator(); + + /* Inherited from DeviceLocatorInterface */ + virtual unsigned long getUniqueLocation() const; + virtual bool equals(DeviceLocatorInterface &that); + virtual std::string getDescription(); + virtual BusFamily getBusFamily() const; + virtual DeviceLocatorInterface *clone() const; + + private: + unsigned long deviceID; + }; + +} + +#endif /* USBDEVICELOCATOR_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBInterface.h b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBInterface.h new file mode 100644 index 0000000..0717e9f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBInterface.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file USBInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is an abstract base class intended to be an interface + * for USB control objects. This allows USB devices to + * be opened generically (just by providing the index of + * the device on the bus) without any concern for + * the vendor ID, product ID, or underlying USB implementation. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USBINTERFACE_H +#define USBINTERFACE_H + +#include "common/buses/Bus.h" +#include "native/usb/NativeUSB.h" +#include "native/usb/USB.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class USBInterface : public Bus { + public: + USBInterface(); + virtual ~USBInterface(); + virtual USB *getUSBDescriptor() const; + virtual DeviceLocatorInterface *getLocation(); + virtual void setLocation(const DeviceLocatorInterface &location) throw (IllegalArgumentException); + virtual BusFamily getBusFamily() const; + virtual bool open() = 0; + virtual void close() = 0; + + protected: + USB *usb; + DeviceLocatorInterface *deviceLocator; + }; + +} + +#endif /* USBINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBTransferHelper.h new file mode 100644 index 0000000..ffd0945 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/buses/usb/USBTransferHelper.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file USBTransferHelper.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a TransferHelper intended for USB communications. + * Each USBTransferHelper must specify a sending and + * receiving endpoint, which will tend to vary according to + * the type of data transfer being conducted. This adapts + * the send() and receive() methods required of a TransferHelper + * according to a particular type of transfer, which may be + * inferred from a ProtocolHint. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USBTRANSFERHELPER_H +#define USBTRANSFERHELPER_H + +#include "common/buses/TransferHelper.h" +#include "native/usb/USB.h" + +namespace seabreeze { + + class USBTransferHelper : public TransferHelper { + public: + USBTransferHelper(USB *usbDescriptor, int sendEndpoint, + int receiveEndpoint); + USBTransferHelper(USB *usbDescriptor); + virtual ~USBTransferHelper(); + + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException); + virtual int send(const std::vector &buffer, unsigned int length) const + throw (BusTransferException); + + protected: + USB *usb; + int sendEndpoint; + int receiveEndpoint; + }; + +} + +#endif /* USBTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/devices/Device.h b/othersoft/shuttercali/source/OSIF/include/common/devices/Device.h new file mode 100644 index 0000000..2c23100 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/devices/Device.h @@ -0,0 +1,129 @@ +/***************************************************//** + * @file Device.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a base class for all sorts of devices. A + * device is really just an aggregation of features + * with the protocols and buses required to access them. + * A Device is intended to represent a single discrete + * piece of equipment that may have several capabilities + * (features) inside. The device may communicate to the + * outside world via seqences of bytes (a protocol) that + * are transferred across a physical medium (the bus). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 DEVICE_H +#define DEVICE_H + +#include +#include +#include "common/buses/Bus.h" +#include "common/buses/BusFamily.h" +#include "common/buses/DeviceLocatorInterface.h" +#include "common/features/Feature.h" +#include "common/features/FeatureFamily.h" +#include "common/protocols/Protocol.h" + + +// usb endpoints are associated with a particular device. +typedef enum usbEndpointType +{ + kEndpointTypePrimaryOut, // slow speed + kEndpointTypePrimaryIn, // slow speed + kEndpointTypeSecondaryOut, // could be high speed + kEndpointTypeSecondaryIn, // could be high speed + kEndpointTypeSecondaryIn2 // generally high speed +} usbEndpointType; + +namespace seabreeze { + + class Device { + public: + Device(); + virtual ~Device(); + std::vector &getBuses(); + std::vector &getFeatures(); + std::vector &getProtocols(); + std::string &getName(); + + // get the usb endpoints, according to the endpointType enumerator, + // if the endpoint type is not used, a 0 is returned + // TODO: this should be delegated down into a Bus instance + // (e.g. found by getBusesByFamily()) for USB. It is inappropriate here. + unsigned char getEndpoint(int *errorCode, usbEndpointType endpointType); + + /* This will allow the driver to probe the device and initialize itself + * based on what it finds there. This should be called shortly after + * open(). The Device instance should use the indicated Bus instance to + * communicate with the hardware and get everything set up. It can + * use any appropriate protocol or protocols that are valid for the Bus. + */ + virtual bool initialize(const Bus &bus); + + /* Each instance of a device is assumed to be associated with a unique + * location on a bus. If the device is connected via multiple buses, then + * a special DeviceLocator and TransferHelper will have to hide those + * details. Otherwise, each connection to the device will be considered + * independent of all others. + */ + virtual DeviceLocatorInterface *getLocation(); + virtual void setLocation(const DeviceLocatorInterface &loc); + + virtual int open(); + + virtual void close(); + + virtual std::vector getBusesByFamily(BusFamily &family); + + virtual seabreeze::ProtocolFamily getSupportedProtocol( + seabreeze::FeatureFamily family, BusFamily bus) = 0; + + virtual std::vector getProtocolsByFamily( + seabreeze::ProtocolFamily &family); + + virtual Bus *getOpenedBus(); + + protected: + std::vector buses; + std::vector features; + std::vector protocols; + + std::string name; + unsigned char usbEndpoint_primary_out; + unsigned char usbEndpoint_primary_in; + unsigned char usbEndpoint_secondary_out; + unsigned char usbEndpoint_secondary_in; + unsigned char usbEndpoint_secondary_in2; + + + DeviceLocatorInterface *location; + Bus *openedBus; + }; + +} + +#endif /* DEVICE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusConnectException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusConnectException.h new file mode 100644 index 0000000..134b32e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusConnectException.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file BusConnectException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when an error is + * encountered when trying to connect to a bus, + * generally a failed open() or socket connect() call, or + * a failed read() or write() due to an EOF. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 BUSCONNECTEXCEPTION_H +#define BUSCONNECTEXCEPTION_H + +#include "common/exceptions/BusException.h" + +namespace seabreeze { + + class BusConnectException : public BusException { + public: + BusConnectException(const std::string &error); + }; + +} + +#endif /* BUSCONNECTEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusException.h new file mode 100644 index 0000000..960ed53 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusException.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file BusException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a base class for a family of exceptions that + * arise from errors in bus transfers. These may be thrown + * at the bus layer, and all exceptions thrown at + * that layer must extend this class so that they can be + * uniformly handled. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_BUSEXCEPTION_H +#define SEABREEZE_BUSEXCEPTION_H + +#include + +namespace seabreeze { + + class BusException : public std::runtime_error { + public: + BusException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusTransferException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusTransferException.h new file mode 100644 index 0000000..a4be719 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/BusTransferException.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file BusTransferException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when an error is + * encountered when trying to read from or write to + * a bus. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 BUSTRANSFEREXCEPTION_H +#define BUSTRANSFEREXCEPTION_H + +#include "common/exceptions/BusException.h" + +namespace seabreeze { + + class BusTransferException : public BusException { + public: + BusTransferException(const std::string &error); + }; + +} + +#endif /* BUSTRANSFEREXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureControlException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureControlException.h new file mode 100644 index 0000000..21b3014 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureControlException.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file FeatureControlException.h + * @date March 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when an error is + * encountered when trying to interact with a feature. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 FEATURECONTROLEXCEPTION_H +#define FEATURECONTROLEXCEPTION_H + +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class FeatureControlException : public FeatureException { + public: + FeatureControlException(const std::string &error); + }; + +} + +#endif /* FEATURECONTROLEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureException.h new file mode 100644 index 0000000..b0163d4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureException.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file FeatureException.h + * @date March 2009 + * @author Ocean Optics, Inc. + * + * This is a base class for a family of exceptions that + * arise from errors in feature interaction. These may be thrown + * at the feature layer, and all exceptions thrown at + * that layer must extend this class so that they can be + * uniformly handled. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FEATUREEXCEPTION_H +#define SEABREEZE_FEATUREEXCEPTION_H + +#include + +namespace seabreeze { + + class FeatureException : public std::runtime_error { + public: + FeatureException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureProtocolNotFoundException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureProtocolNotFoundException.h new file mode 100644 index 0000000..654af22 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/FeatureProtocolNotFoundException.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file FeatureProtocolNotFoundException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when a protocol is + * specified, but no matching implementation of that + * protocol can be found for a particular feature. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 FEATUREPROTOCOLNOTFOUNDEXCEPTION_H +#define FEATUREPROTOCOLNOTFOUNDEXCEPTION_H + +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class FeatureProtocolNotFoundException : public FeatureException { + public: + FeatureProtocolNotFoundException(const std::string &error); + }; + +} + +#endif /* FEATUREPROTOCOLNOTFOUNDEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/IllegalArgumentException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/IllegalArgumentException.h new file mode 100644 index 0000000..aa457b5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/IllegalArgumentException.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file IllegalArgumentException.h + * @date March 2009 + * @author Ocean Optics, Inc. + * + * This is an exception for use when a value is passed to + * a method that is not permitted. This may include + * specifying a parameter that is out of bounds or of + * the wrong type. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_ILLEGALARGUMENTEXCEPTION_H +#define SEABREEZE_ILLEGALARGUMENTEXCEPTION_H + +#include +#include + +namespace seabreeze { + + class IllegalArgumentException : public std::invalid_argument { + public: + IllegalArgumentException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/NumberFormatException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/NumberFormatException.h new file mode 100644 index 0000000..0489345 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/NumberFormatException.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file NumberFormatException.h + * @date March 2009 + * @author Ocean Optics, Inc. + * + * This is an exception for use when a string is to be + * parsed into a number but the string does not contain + * a recognizable number. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_NUMBERFORMATEXCEPTION_H +#define SEABREEZE_NUMBERFORMATEXCEPTION_H + +#include +#include + +namespace seabreeze { + + class NumberFormatException : public std::runtime_error { + public: + NumberFormatException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolBusMismatchException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolBusMismatchException.h new file mode 100644 index 0000000..e593994 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolBusMismatchException.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file ProtocolBusMismatchException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when a protocol is + * specified, but the bus and protocol are not suited to + * each other (e.g. there is no bus helper for the hints + * the protocol can provide). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 PROTOCOLBUSMISMATCHEXCEPTION_H +#define PROTOCOLBUSMISMATCHEXCEPTION_H + +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + + class ProtocolBusMismatchException : public ProtocolException { + public: + ProtocolBusMismatchException(const std::string &error); + }; + +} + +#endif /* PROTOCOLBUSMISMATCHEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolException.h new file mode 100644 index 0000000..34dcb97 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolException.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file ProtocolException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a base class for a family of exceptions that + * arise from errors in protocols. These may be thrown + * at the protocol layer, and all exceptions thrown at + * that layer must extend this class so that they can be + * uniformly handled. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLEXCEPTION_H +#define SEABREEZE_PROTOCOLEXCEPTION_H + +#include +#include + +namespace seabreeze { + + class ProtocolException : public std::runtime_error { + public: + ProtocolException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolFormatException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolFormatException.h new file mode 100644 index 0000000..6067315 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolFormatException.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file ProtocolFormatException.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This exception should be used when a protocol message + * cannot be decoded, fails a checksum, or otherwise is + * out of spec. This may indicate that the driver is now + * out of synch with this code and that measures should be + * taken to re-establish communications. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 PROTOCOLFORMATEXCEPTION_H +#define PROTOCOLFORMATEXCEPTION_H + +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + + class ProtocolFormatException : public ProtocolException { + public: + ProtocolFormatException(const std::string &error); + }; + +} + +#endif /* PROTOCOLFORMATEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolTransactionException.h b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolTransactionException.h new file mode 100644 index 0000000..edde640 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/exceptions/ProtocolTransactionException.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file ProtocolTransactionException.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a base class for a family of exceptions that + * arise from errors in during OBPTransactions. These may be thrown + * at the protocol layer, and all exceptions thrown at + * that layer must extend this class so that they can be + * uniformly handled. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLTRANSACTIONEXCEPTION_H +#define SEABREEZE_PROTOCOLTRANSACTIONEXCEPTION_H + +#include +#include + +namespace seabreeze { + + class ProtocolTransactionException : public std::runtime_error { + public: + ProtocolTransactionException(const std::string &error); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/features/Feature.h b/othersoft/shuttercali/source/OSIF/include/common/features/Feature.h new file mode 100644 index 0000000..ad6163c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/features/Feature.h @@ -0,0 +1,71 @@ +/***************************************************//** + * @file Feature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is an abstract interface that other feature types will + * implement. A Feature is taken to be some capability of + * a Device that is relatively self-contained. For instance, + * an analog output voltage would be a Feature. Features can + * also contain multiple functions; for instance, a TEC may + * be able to report a temperature, take a temperature as a + * set point, and turn on or off. These capabilities are + * interrelated, and would be considered a single feature. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 FEATURE_H +#define FEATURE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/features/FeatureFamily.h" +#include "common/exceptions/FeatureException.h" +#include "common/protocols/Protocol.h" +#include + +namespace seabreeze { + + class Feature { + public: + virtual ~Feature() = 0; + + /* Allow the object that represents a given feature to initialize + * itself by reading from the corresponding feature on the real + * device, and/or put the real device feature into a known state. + * This should return true if the feature is ready to be used, and false + * otherwise. + */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException) = 0; + + virtual FeatureFamily getFeatureFamily() = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline Feature::~Feature() {} +} + +#endif /* FEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/features/FeatureFamily.h b/othersoft/shuttercali/source/OSIF/include/common/features/FeatureFamily.h new file mode 100644 index 0000000..66d814e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/features/FeatureFamily.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file FeatureFamily.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This provides a way to describe different kinds + * features (e.g. spectrometer, TEC) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FEATUREFAMILY_H +#define SEABREEZE_FEATUREFAMILY_H + +#include + +namespace seabreeze { + class FeatureFamily { + public: + FeatureFamily(); + virtual ~FeatureFamily(); + virtual std::string getName(); + virtual bool equals(const FeatureFamily &that); + virtual unsigned short getType(); + + protected: + FeatureFamily(std::string name, unsigned short id); + + private: + std::string featureName; + unsigned short type; + }; +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/features/FeatureImpl.h b/othersoft/shuttercali/source/OSIF/include/common/features/FeatureImpl.h new file mode 100644 index 0000000..8c9349a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/features/FeatureImpl.h @@ -0,0 +1,88 @@ +/***************************************************//** + * @file FeatureImpl.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * This is a simple base class that other feature types will + * extend. A Feature is taken to be some capability of + * a Device that is relatively self-contained. For instance, + * an analog output voltage would be a Feature. Features can + * also contain multiple functions; for instance, a TEC may + * be able to report a temperature, take a temperature as a + * set point, and turn on or off. These capabilities are + * interrelated, and would be considered a single feature. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 FEATUREIMPL_H +#define FEATUREIMPL_H + +#include "common/SeaBreeze.h" +#include "common/exceptions/FeatureProtocolNotFoundException.h" +#include "common/features/Feature.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + /* This does virtual inheritance from Feature because it is assumed that + * in some cases there will be diamond inheritance. This will generally + * only happen where one top-level Feature is implemented by deriving from + * another Feature. + */ + class FeatureImpl : public virtual Feature { + public: + FeatureImpl(); + virtual ~FeatureImpl(); + + /* Allow the object that represents a given feature to initialize + * itself by reading from the corresponding feature on the real + * device, and/or put the real device feature into a known state. + * Overriding this is not required. This should return true if + * the feature is ready to be used, and false otherwise. + */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + virtual FeatureFamily getFeatureFamily() = 0; + + protected: + std::vector protocols; + + /* Protocols are described by their base class (Protocol) + * and may be designated that way. However, different + * functionality within a given command set may be broken + * into different implementation types, all of which extend + * the base Protocol class. This is a simple lookup mechanism + * to use the Protocol that some anonymous caller might + * provide as a point of reference to then find the extended + * Protocol class that can be used to access certain features. + */ + ProtocolHelper *lookupProtocolImpl(const Protocol &protocol) + throw (FeatureProtocolNotFoundException); + }; + +} + +#endif /* FEATUREIMPL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/common/globals.h b/othersoft/shuttercali/source/OSIF/include/common/globals.h new file mode 100644 index 0000000..6195a3d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/globals.h @@ -0,0 +1,65 @@ +/** +* @file globals.h +* @author Mark Zieg +* @date Sep 26, 2012 +* @brief Provides a single point of maintenance for anything you want +* included, defined, or set across every file in the application +* (such as memory profiling, etc). Normally empty. +* +* LICENSE: +* +* SeaBreeze Copyright (C) 2014, 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_GLOBALS_H +#define SEABREEZE_GLOBALS_H + +// change to "#if 1" to enable memory heap debugging under Visual Studio +#if 0 + #ifdef _WINDOWS + + // For these to work right, you need to #define _CRTDBG_MAP_ALLOC and + // _CRTDBG_MAP_ALLOC_NEW in your Visual Studio project (i.e., Project + // -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor + // Definitions). #Defining them here in your header files DOES NOT + // WORK, because Visual Studio will internally include many system + // headers (including stdafx.h) long before you get here. + // + // @see http://msdn.microsoft.com/en-us/library/e5ewb1h3%28v=vs.80%29.aspx + // @see http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/ebc7dd7a-f3c6-49f1-8a60-e381052f21b6, + + #pragma message(" (Windows memory debugging enabled)") + + // these will provide leak profiling for C malloc(), etc + #include + #include + + // these will provide leak profiling for C++ 'new' + #ifndef DBG_NEW + #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) + #define new DBG_NEW + #endif + + #endif +#endif + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/Exchange.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/Exchange.h new file mode 100644 index 0000000..785a62c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/Exchange.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file Exchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is simply an interface that other classes will + * extend to have a common transfer() and getHints methods + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_EXCHANGE_H +#define SEABREEZE_EXCHANGE_H + +#include +#include "common/buses/TransferHelper.h" +#include "common/protocols/ProtocolHint.h" +#include "common/Data.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + + class Exchange { + public: + Exchange(); + Exchange(std::vector *hints); + virtual ~Exchange(); + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException) = 0; + virtual const std::vector &getHints(); + + protected: + std::vector *hints; + }; + +} + +#endif /* SEABREEZE_EXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/Protocol.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/Protocol.h new file mode 100644 index 0000000..a86fc53 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/Protocol.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file Protocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a simple identifier cookie that will allow two + * objects to agree on whether they support a given command + * set (protocol). Each will hold Protocol objects that they + * can then compare to see if they agree. This allows a loose + * binding between sets of Exchanges (elsewhere called protocols) + * and buses. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOL_H +#define SEABREEZE_PROTOCOL_H + +#include "common/protocols/ProtocolFamily.h" + +namespace seabreeze { + + class Protocol { + public: + Protocol(int id); + /* Copy constructor */ + Protocol(Protocol const &that); + virtual ~Protocol(); + bool equals(Protocol const &that); + + virtual ProtocolFamily getProtocolFamily() = 0; + + protected: + /* Protected for derived classes to use. */ + Protocol(); + int id; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolFamily.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolFamily.h new file mode 100644 index 0000000..987092f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolFamily.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file ProtocolFamily.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This provides a way to describe different kinds + * protocols (e.g. OOI, OBP) generically. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLFAMILY_H +#define SEABREEZE_PROTOCOLFAMILY_H + +#include + +namespace seabreeze { + class ProtocolFamily { + public: + virtual ~ProtocolFamily(); + virtual std::string getName(); + virtual bool equals(const ProtocolFamily &that); + virtual unsigned short getType(); + + protected: + ProtocolFamily(std::string name, unsigned short id); + + private: + std::string protocolName; + unsigned short type; + }; +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHelper.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHelper.h new file mode 100644 index 0000000..7e4a663 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHelper.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file ProtocolHelper.h + * @date July 2009 + * @author Ocean Optics, Inc. + * + * Feature instances may look up an implementation object + * that matches a particular Protocol. All such implementations + * should in some way derive from ProtocolHelper so that + * Feature's look up mechanism can return them. It is + * expected that each Feature will have a corresponding + * interface at the Protocol layer; those interface classes + * should derive from this class, and their implementations + * will thus extend this as well. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLHELPER_H +#define SEABREEZE_PROTOCOLHELPER_H + +#include "common/protocols/Protocol.h" + +namespace seabreeze { + + class ProtocolHelper { + public: + ProtocolHelper(Protocol *proto); + virtual ~ProtocolHelper(); + Protocol &getProtocol(); + + protected: + /* Protected for derived classes to use. */ + ProtocolHelper(); + Protocol *protocol; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHint.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHint.h new file mode 100644 index 0000000..5cc2c14 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/ProtocolHint.h @@ -0,0 +1,73 @@ +/***************************************************//** + * @file ProtocolHint.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * Hints are used to identify particular characteristics about + * protocol Transfer objects. A hint may be used to indicate + * to a bus some detail it needs about making a transfer, e.g. + * what endpoint would be appropriate for USB. Note that the + * bus (or its helpers) are under no obligation to respect hints. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_PROTOCOLHINT_H +#define SEABREEZE_PROTOCOLHINT_H + +#include "common/SeaBreeze.h" +#include + +namespace seabreeze { + + class ProtocolHint { + public: + ProtocolHint(int id, std::string desc); + + /* For derived classes that will fill in their own values + * and for containers to be able to initialize themselves. + * This does not set any meaningful values and should not be + * relied on to create a proper instance. + */ + ProtocolHint(); + + virtual ~ProtocolHint(); + std::string getDescription(); + int getID() const; + + /* Overloading the equality operator so that this can be + * used as a key for hash_map associations without the actual + * key objects having to be identical. + */ + bool operator==(const ProtocolHint &that); + + protected: + int id; + std::string description; + }; + +} + +#endif /* SEABREEZE_PROTOCOLHINT_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/Transaction.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/Transaction.h new file mode 100644 index 0000000..f37a529 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/Transaction.h @@ -0,0 +1,82 @@ +/***************************************************//** + * @file Transaction.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * The Transaction class is simply a wrapper + * around one or more Transfer objects that must + * be executed in a particular order. This is + * provided for convenience. Some transfers + * to Ocean Optics spectrometers put the spectrometer + * into a particular state where it expects another + * action to be taken, and Transaction objects can + * be used to ensure that all expected operations occur. + * + * Some actions, like requesting a spectrum, do not + * necessarily require that the next action be a read + * operation. Thus, some Transfers that appear to follow + * a causal chain may not in fact make good Transactions. + * In this case, reading the status of the device until + * it reports data ready is a common operation before + * reading the spectrum. + * + * Note that the Transaction class has no notion of buses + * or protocols, and this is by design. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TRANSACTION_H +#define SEABREEZE_TRANSACTION_H + +#include +#include "common/protocols/Exchange.h" +#include "common/protocols/Transfer.h" +#include "common/buses/TransferHelper.h" +#include "common/protocols/ProtocolHint.h" +#include "common/Data.h" + +namespace seabreeze { + + class Transaction : public Exchange { + public: + Transaction(); + virtual ~Transaction(); + void addTransfer(Transfer *xfer); + + /* Inherited from Exchange */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + std::vector transfers; + + private: + void updateHints(); + + }; + +} + +#endif /* SEABREEZE_TRANSACTION_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/common/protocols/Transfer.h b/othersoft/shuttercali/source/OSIF/include/common/protocols/Transfer.h new file mode 100644 index 0000000..10e6b03 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/common/protocols/Transfer.h @@ -0,0 +1,93 @@ +/***************************************************//** + * @file Transfer.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * The Transfer class captures a simplex + * data transfer to or from a device. At this + * level, there is no notion of a particular bus, + * just data, length, and direction. + * + * The bus aspects are encapsulated in a "helper" + * object that must be provided when the Transfer + * is executed. The helper must provide send() and + * receive() methods taking a buffer and length + * only. All of the details in getting the transfer to + * or from the other end must be handled by the helper. + * The helper is expected to be created by some aspect + * of the driver for the device in question. It contains + * information about the connection and the particulars + * about routing data in and out. + * + * Note that the Transfer class is completely orthagonal to any + * particular protocol. It is expected that a protocol may be + * built up as a collection of related Transfer types. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TRANSFER_H +#define SEABREEZE_TRANSFER_H + +#include +#include "common/protocols/Exchange.h" +#include "common/protocols/ProtocolHint.h" +#include "common/Data.h" + +typedef unsigned int direction_t; + +namespace seabreeze { + + class Transfer : public Exchange { + public: + + /* Note that the size of the provided buffer and the specified length + * of the transfer itself do not need to agree. If the transfer requires + * more space than the buffer provides, the buffer will be resized. + * If the buffer is created larger than is needed, only the given length + * will be sent or received. This allows for some freedom in buffer + * management. + */ + Transfer(std::vector *hints, std::vector *buffer, + direction_t direction, unsigned int length); + + virtual ~Transfer(); + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + static const direction_t TO_DEVICE; + static const direction_t FROM_DEVICE; + + protected: + Transfer(); + void checkBufferSize(); + + unsigned int length; + std::vector *buffer; + direction_t direction; + }; + +} + +#endif /* SEABREEZE_TRANSFER_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/Inet4Address.h b/othersoft/shuttercali/source/OSIF/include/native/network/Inet4Address.h new file mode 100644 index 0000000..a52058a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/Inet4Address.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file Inet4Address.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_INET4ADDRESS_H +#define SEABREEZE_INET4ADDRESS_H + +#include +#include "common/exceptions/IllegalArgumentException.h" +#include "common/SeaBreeze.h" + +#ifdef _WINDOWS +#include +#else +#include +#endif + +namespace seabreeze { + class Inet4Address { + public: + Inet4Address(); + Inet4Address(std::string ipAddressQuads) + throw (IllegalArgumentException); + Inet4Address(struct in_addr *ipAddr); + Inet4Address(const Inet4Address &that); + ~Inet4Address(); + + struct in_addr getAddress(); + + std::string getHostAddress(); + + private: + struct in_addr in; + }; +} + +#endif /* SEABREEZE_INET4ADDRESS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/Socket.h b/othersoft/shuttercali/source/OSIF/include/native/network/Socket.h new file mode 100644 index 0000000..0446b79 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/Socket.h @@ -0,0 +1,80 @@ +/***************************************************//** + * @file Socket.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_SOCKET_H +#define SEABREEZE_SOCKET_H + +/* Includes */ +#include "common/SeaBreeze.h" +#include "common/exceptions/BusTransferException.h" +#include "common/exceptions/BusConnectException.h" +#include "native/network/SocketException.h" +#include "native/network/UnknownHostException.h" +#include "native/network/Inet4Address.h" +#include + +namespace seabreeze { + + class Socket { + public: + static Socket *create(); + + virtual ~Socket(); + + virtual void connect(Inet4Address &addr, int port) + throw (UnknownHostException, BusConnectException) = 0; + virtual void connect(const std::string host, int port) + throw (UnknownHostException, BusConnectException) = 0; + + virtual void close() throw (BusException) = 0; + virtual bool isClosed() = 0; + virtual bool isBound() = 0; + + /* Socket options */ + virtual int getSOLinger() throw (SocketException) = 0; + virtual void setSOLinger(bool enable, int linger) + throw (SocketException) = 0; + virtual unsigned long getReadTimeoutMillis() + throw (SocketException) = 0; + virtual void setReadTimeoutMillis(unsigned long timeout) + throw (SocketException) = 0; + + /* Data transfer */ + virtual int read(unsigned char *buffer, unsigned long length) + throw (BusTransferException) = 0; + virtual int write(const unsigned char *buffer, unsigned long length) + throw (BusTransferException) = 0; + + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline Socket::~Socket() {} +} + +#endif /* SEABREEZE_SOCKET_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/SocketException.h b/othersoft/shuttercali/source/OSIF/include/native/network/SocketException.h new file mode 100644 index 0000000..f7ef56c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/SocketException.h @@ -0,0 +1,44 @@ +/***************************************************//** + * @file SocketException.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_SOCKETEXCEPTION_H +#define SEABREEZE_SOCKETEXCEPTION_H + +#include "common/exceptions/BusException.h" + +namespace seabreeze { + + class SocketException : public BusException { + public: + SocketException(const std::string &error); + }; + +} + +#endif /* SEABREEZE_SOCKETEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/SocketTimeoutException.h b/othersoft/shuttercali/source/OSIF/include/native/network/SocketTimeoutException.h new file mode 100644 index 0000000..d591778 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/SocketTimeoutException.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file SocketTimeoutException.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_SOCKETTIMEOUTEXCEPTION_H +#define SEABREEZE_SOCKETTIMEOUTEXCEPTION_H + +#include "native/network/SocketException.h" + +namespace seabreeze { + + class SocketTimeoutException : public SocketException { + public: + SocketTimeoutException(const std::string &error); + }; + +} + +#endif /* SEABREEZE_SOCKETTIMEOUTEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/UnknownHostException.h b/othersoft/shuttercali/source/OSIF/include/native/network/UnknownHostException.h new file mode 100644 index 0000000..261f80b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/UnknownHostException.h @@ -0,0 +1,44 @@ +/***************************************************//** + * @file UnknownHostException.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_UNKNOWNHOSTEXCEPTION_H +#define SEABREEZE_UNKNOWNHOSTEXCEPTION_H + +#include + +namespace seabreeze { + + class UnknownHostException : public std::runtime_error { + public: + UnknownHostException(const std::string &error); + }; + +} + +#endif /* SEABREEZE_UNKNOWNHOSTEXCEPTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/posix/NativeSocketPOSIX.h b/othersoft/shuttercali/source/OSIF/include/native/network/posix/NativeSocketPOSIX.h new file mode 100644 index 0000000..d8715b5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/posix/NativeSocketPOSIX.h @@ -0,0 +1,71 @@ +/***************************************************//** + * @file NativeSocketPOSIX.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_NATIVESOCKETPOSIX_H +#define SEABREEZE_NATIVESOCKETPOSIX_H + +#include "native/network/Socket.h" +#include "native/network/Inet4Address.h" +#include "common/exceptions/BusConnectException.h" +#include + +namespace seabreeze { + class NativeSocketPOSIX : public Socket { + public: + NativeSocketPOSIX(); + virtual ~NativeSocketPOSIX(); + + virtual void connect(Inet4Address &addr, int port) + throw (UnknownHostException, BusConnectException); + virtual void connect(const std::string hostname, int port) + throw (UnknownHostException, BusConnectException); + + virtual void close() throw (BusException); + virtual bool isClosed(); + virtual bool isBound(); + + virtual int getSOLinger() throw (SocketException); + virtual void setSOLinger(bool enable, int linger) throw (SocketException); + virtual unsigned long getReadTimeoutMillis() throw (SocketException); + virtual void setReadTimeoutMillis(unsigned long timeout) throw (SocketException); + + virtual int read(unsigned char *buffer, unsigned long length) + throw (BusTransferException); + virtual int write(const unsigned char *buffer, unsigned long length) + throw (BusTransferException); + + private: + int sock; + bool bound; + bool closed; + Inet4Address address; + }; +} + +#endif /* SEABREEZE_NATIVESOCKETPOSIX_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/network/windows/NativeSocketWindows.h b/othersoft/shuttercali/source/OSIF/include/native/network/windows/NativeSocketWindows.h new file mode 100644 index 0000000..c19d0bf --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/network/windows/NativeSocketWindows.h @@ -0,0 +1,73 @@ +/***************************************************//** + * @file NativeSocketWindows.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_NATIVESOCKETWINDOWS_H +#define SEABREEZE_NATIVESOCKETWINDOWS_H + +#include "common/SeaBreeze.h" +#include "native/network/Socket.h" +#include "native/network/Inet4Address.h" +#include "common/exceptions/BusConnectException.h" +#include +#include + +namespace seabreeze { + class NativeSocketWindows : public Socket { + public: + NativeSocketWindows(); + virtual ~NativeSocketWindows(); + + virtual void connect(Inet4Address &addr, int port) + throw (UnknownHostException, BusConnectException); + virtual void connect(const std::string hostname, int port) + throw (UnknownHostException, BusConnectException); + + virtual void close() throw (BusException); + virtual bool isClosed(); + virtual bool isBound(); + + virtual int getSOLinger() throw (SocketException); + virtual void setSOLinger(bool enable, int linger) throw (SocketException); + virtual unsigned long getReadTimeoutMillis() throw (SocketException); + virtual void setReadTimeoutMillis(unsigned long timeout) throw (SocketException); + + virtual int read(unsigned char *buffer, unsigned long length) + throw (BusTransferException); + virtual int write(const unsigned char *buffer, unsigned long length) + throw (BusTransferException); + + private: + SOCKET sock; + bool bound; + bool closed; + Inet4Address address; + }; +} + +#endif /* SEABREEZE_NATIVESOCKETWINDOWS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/rs232/NativeRS232.h b/othersoft/shuttercali/source/OSIF/include/native/rs232/NativeRS232.h new file mode 100644 index 0000000..974d06b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/rs232/NativeRS232.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file NativeRS232.h + * @date April 21, 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NATIVERS232_H +#define NATIVERS232_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define OPEN_OK 0 +#define NO_DEVICE_FOUND -1 + +void *RS232Open(char *device, int *errorCode); + +int RS232Close(void *handle); + +int RS232Write(void *handle, char *data, int numberOfBytes); + +int RS232Read(void *handle, char *buffer, int numberOfBytes); + +int RS232SetBaudRate(void *handle, int rate); + +int RS232ClearInputBuffer(void *handle); + +int RS232ClearOutputBuffer(void *handle); + +int RS232WaitForWrite(void *handle); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* NATIVERS232_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/rs232/RS232.h b/othersoft/shuttercali/source/OSIF/include/native/rs232/RS232.h new file mode 100644 index 0000000..d257efc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/rs232/RS232.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file RS232.h + * @date April 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_RS232_H +#define SEABREEZE_RS232_H + +#include "native/rs232/NativeRS232.h" + +namespace seabreeze { + + class RS232 { + public: + RS232(const char *devicePath, int baudRate); + virtual ~RS232(); + + bool open(); + bool close(); + int write(void *data, unsigned int length_bytes); + int read(void *data, unsigned int length_bytes); + + void setVerbose(bool v); + bool isOpened(); + + protected: + + /* These methods are primarily for debugging. */ + void rs232HexDump(void *x, int length, bool out); + void hexDump(void *x, int length); + void describeTransfer(int length, bool out); + + void *descriptor; + bool opened; + bool verbose; + char *devicePath; + int baudRate; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/native/rs232/windows/NativeRS232Windows.h b/othersoft/shuttercali/source/OSIF/include/native/rs232/windows/NativeRS232Windows.h new file mode 100644 index 0000000..75d0e9b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/rs232/windows/NativeRS232Windows.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file NativeRS232Windows.h + * @date April 21, 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NATIVERS232WINDOWS_H +#define NATIVERS232WINDOWS_H + +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#include +#include +#include +#include +#include +#include + +#ifndef INVALID_HANDLE_VALUE +#define INVALID_HANDLE_VALUE (-1) +#endif + +#ifdef __BORLANDC__ +#define EXPORTED __declspec(dllexport) __stdcall +#else +#define EXPORTED __declspec(dllexport) +#endif /* __BORLANDC__ */ +#define int64 __int64 + +#endif /* NATIVERS232WINDOWS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/system/NativeSystem.h b/othersoft/shuttercali/source/OSIF/include/native/system/NativeSystem.h new file mode 100644 index 0000000..b3e34b3 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/system/NativeSystem.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file NativeSystem.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This file has declarations for the native C functions + * needed to access certain non-portable system calls. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NATIVE_SYSTEM_H +#define NATIVE_SYSTEM_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Native C prototypes */ + +void sleepMilliseconds(unsigned int msecs); +int systemInitialize(); +void systemShutdown(); + +/* End of C prototypes */ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* NATIVE_SYSTEM_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/system/System.h b/othersoft/shuttercali/source/OSIF/include/native/system/System.h new file mode 100644 index 0000000..757a527 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/system/System.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file System.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * The System class provides an abstract interface to + * certain system calls. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_SYSTEM_H +#define SEABREEZE_SYSTEM_H + +namespace seabreeze { + + class System { + public: + System(); + virtual ~System(); + + static void sleepMilliseconds(unsigned int millis); + static bool initialize(); + static void shutdown(); + + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/native/usb/NativeUSB.h b/othersoft/shuttercali/source/OSIF/include/native/usb/NativeUSB.h new file mode 100644 index 0000000..ce054c7 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/usb/NativeUSB.h @@ -0,0 +1,226 @@ +/***************************************************//** + * @file NativeUSB.h + * @date October 31, 2007 + * @author Ocean Optics, Inc. + * + * This provides a relatively simple interface for + * opening, closing, writing to, and reading from Ocean + * Optics USB Devices. It has been extended to provide + * more complete USB functionality at least for Linux, + * and equivalent functionality should be brought back + * in for Windows and MacOSX. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NATIVEUSB_H +#define NATIVEUSB_H + +#ifdef __cplusplus +extern "C" { +#endif /* cplusplus */ + +#define OPEN_OK 0 +#define NO_DEVICE_FOUND -1 +#define NO_DEVICE_MATCH -2 +#define CLAIM_INTERFACE_FAILED -3 +#define CLOSE_OK 0 +#define CLOSE_ERROR -1 +#define WRITE_FAILED -1 +#define READ_FAILED -1 +#define ABORT_OK 0 +#define ABORT_FAILED -1 +#define RESET_OK 0 +#define RESET_FAILED -1 + +struct USBConfigurationDescriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; +}; + +struct USBDeviceDescriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct USBInterfaceDescriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; +}; + +struct USBEndpointDescriptor { + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; +}; + +//------------------------------------------------------------------------------ +// This function attempts to discover all devices with the given product +// and vendor IDs. Descriptors for each found device will be placed in the +// provided long buffer. +// +// PARAMETERS: +// vendorID: The vendor ID to match with devices on the bus +// productID: The product ID to match with devices on the bus +// output: A buffer of longs that will be populated with unique IDs for each +// device found that matches the VID and PID +// max_devices: A limit on how many IDs can be put into the output buffer +// +// RETURN VALUE: +// The number of devices successfully found, or -1 if there was an error. +int +USBProbeDevices(int vendorID, int productID, unsigned long *output, + int max_devices); + +//------------------------------------------------------------------------------ +// This function attempts to open a device with the given product and vendor +// ID's at the specified index. +// +// PARAMETERS: +// deviceID: The ID of a device that has been provided by probeDevices(). +// errorCode: A pointer to an integer that will be set to an error code of +// either NO_DEVICE_FOUND or NO_DEVICE_MATCH if an error occured +// while trying to open the device or OPEN_OK if the device was +// found and opened. +// +// RETURN VALUE: +// Returns a void pointer which equals a handle to the device if the device was +// found and opened successfully, or NULL if the device was not opened +// successfully. The value of the 'errorCode' parameter should be checked +// against the following before using the handle: +// - NO_DEVICE_FOUND signifying that no device was found with the specified ID +// or that the device with the specified ID could not be opened +//------------------------------------------------------------------------------ +void * +USBOpen(unsigned long deviceID, int *errorCode); + +//------------------------------------------------------------------------------ +// This function attempts to close the device attached to the given handle. +// +// PARAMETERS: +// handle: The device handle obtained via the open() function. +// +// RETURN VALUE: +// Returns an integer which will be equal to either: +// - CLOSE_OK if the device was closed successfully +// - CLOSE_ERROR if some error occured +//------------------------------------------------------------------------------ +int +USBClose(void *handle); + +//------------------------------------------------------------------------------ +// This function writes the given data to the device attached to the given +// handle. +// +// PARAMETERS: +// handle: The device handle obtained via the open() function. +// endpoint: The endpoint on the device to write the data to. +// data: A pointer to the dynamically allocated byte array of data to be written +// size: The number of bytes to be written +// +// RETURN VALUE: +// Returns an integer which will be equal to either: +// - The number of bytes written to the endpoint if the write was successful +// - WRITE_FAILED if the data was not written to the device +//------------------------------------------------------------------------------ +int +USBWrite(void *handle, unsigned char endpoint, char * data, int numberOfBytes); + +//------------------------------------------------------------------------------ +// This function reads data from the device attached to the given handle into +// the specified byte array. +// +// PARAMETERS: +// handle: The device handle obtained via the open() function. +// endpoint: The endpoint on the device to read the data from. +// data: A pointer to the dynamically allocated byte array to store the data. +// size: The number of bytes to be read. +// +// RETURN VALUE: +// Returns an integer which will be equal to either: +// - The number of bytes read from the endpoint if the read was successful +// - READ_FAILED if the data was not successfully read from the device +//------------------------------------------------------------------------------ +int +USBRead(void *handle, unsigned char endpoint, char * data, int numberOfBytes); + +//------------------------------------------------------------------------------ +// This function attempts to clear any stall on the given endpoint. +// +// PARAMETERS: +// handle: The device handle obtained via the open() function. +// endpoint: The endpoint on the device to clear a stall condition on. +// +// RETURN VALUE: +// No value is returned (void). +//------------------------------------------------------------------------------ +void +USBClearStall(void *handle, unsigned char endpoint); + +int +USBGetDeviceDescriptor(void *handle, struct USBDeviceDescriptor *desc); + +int +USBGetInterfaceDescriptor(void *handle, struct USBInterfaceDescriptor *desc); + +int +USBGetEndpointDescriptor(void *handle, int endpoint_index, struct USBEndpointDescriptor *desc); + +int +USBGetStringDescriptor(void *handle, unsigned int string_index, char *buffer, int maxLength); + + +#ifdef __cplusplus +} +#endif /* _cplusplus */ + +#endif /* NATIVEUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/usb/USB.h b/othersoft/shuttercali/source/OSIF/include/native/usb/USB.h new file mode 100644 index 0000000..70a014f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/usb/USB.h @@ -0,0 +1,84 @@ +/***************************************************//** + * @file USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_USB_H +#define SEABREEZE_USB_H + +#include "native/usb/USBDiscovery.h" +#include "native/usb/NativeUSB.h" +#include + +namespace seabreeze { + + /* Empty declaration of USBDiscovery to deal with cross-includes */ + class USBDiscovery; + + class USB { + public: + virtual ~USB(); + + bool open(); + bool close(); + int write(int endpoint, void *data, unsigned int length_bytes); + int read(int endpoint, void *data, unsigned int length_bytes); + void clearStall(int endpoint); + + static void setVerbose(bool v); + + int getDeviceDescriptor(struct USBDeviceDescriptor *desc); + int getInterfaceDescriptor(struct USBInterfaceDescriptor *desc); + /* Get the endpoint descriptor where index is the endpoint index. */ + int getEndpointDescriptor(int index, struct USBEndpointDescriptor *epDesc); + std::string *getStringDescriptor(int index); + int getMaxPacketSize(); + + bool isOpened(); + + /* This allows the USBDiscovery class to access the protected + * constructor and act as a factory for USB instances. + */ + friend class USBDiscovery; + + protected: + + /* These methods are primarily for debugging. */ + void usbHexDump(void *x, int length, int endpoint); + void hexDump(void *x, int length); + void describeTransfer(const char *label, int length, void* data, int endpoint, bool hexdump); + USB(unsigned long deviceID); + + void *descriptor; + bool opened; + static bool verbose; + unsigned long deviceID; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/native/usb/USBDiscovery.h b/othersoft/shuttercali/source/OSIF/include/native/usb/USBDiscovery.h new file mode 100644 index 0000000..fda1c0d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/usb/USBDiscovery.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file USBDiscovery.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USBDISCOVERY_H +#define USBDISCOVERY_H + +#include "native/usb/USB.h" +#include + +namespace seabreeze { + + /* Empty declaration of USB to deal with cross-includes */ + class USB; + + class USBDiscovery { + public: + USBDiscovery(); + ~USBDiscovery(); + + /** + * Probes the bus for devices of the given VID and PID and returns + * a vector of identifiers. Note that these IDs are implementation- + * specific and are not necessarily portable between platforms. They + * are not guaranteed to be constant from one program execution to the + * next, though they should remain constant from one invocation of this + * method to the next within one execution if no devices change status. + */ + std::vector *probeDevices(int vendorID, int productID); + + /** + * Given an identifier from probeDevices(), create a USB interface to + * the device that can be used to open/write/read/close the device. + */ + USB *createUSBInterface(unsigned long deviceID); + }; + +} + +#endif /* USBDISCOVERY_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/native/usb/winusb/WindowsGUID.h b/othersoft/shuttercali/source/OSIF/include/native/usb/winusb/WindowsGUID.h new file mode 100644 index 0000000..de3d140 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/native/usb/winusb/WindowsGUID.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file WindowsGUID.h + * @date June 2009 + * @author Ocean Optics, Inc. + * + * This provides GUID definitions for supported devices. + * These must match what appears in the .inf file for the + * devices to be found properly through the WinUSB API. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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. + *******************************************************/ + +#pragma once + +#ifndef SEABREEZE_WINDOWS_GUID_H +#define SEABREEZE_WINDOWS_GUID_H + +// {BAD36DAB-A3D2-4a0e-8B2E-DA36202187D4} +DEFINE_GUID(GUID_DEVCLASS_OCEANOPTICS_USB, +0xbad36dab, 0xa3d2, 0x4a0e, 0x8b, 0x2e, 0xda, 0x36, 0x20, 0x21, 0x87, 0xd4); + +// {DBBAD306-1786-4f2e-A8AB-340D45F0653F} +DEFINE_GUID(GUID_DEVINTERFACE_OCEANOPTICS_USB, +0xdbbad306, 0x1786, 0x4f2e, 0xa8, 0xab, 0x34, 0xd, 0x45, 0xf0, 0x65, 0x3f); + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/BlazeTCPIPv4.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/BlazeTCPIPv4.h new file mode 100644 index 0000000..b1f33e5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/BlazeTCPIPv4.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file BlazeTCPIPv4.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_BLAZETCPIPV4_H +#define SEABREEZE_BLAZETCPIPV4_H + +#include "common/buses/network/TCPIPv4SocketBus.h" + +namespace seabreeze { + class BlazeTCPIPv4 : public TCPIPv4SocketBus { + public: + BlazeTCPIPv4(); + virtual ~BlazeTCPIPv4(); + + virtual bool open(); + virtual void close(); + }; +} + +#endif /* SEABREEZE_BLAZETCPIPV4_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/JazTCPIPv4.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/JazTCPIPv4.h new file mode 100644 index 0000000..2586c2f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/network/JazTCPIPv4.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file JazTCPIPv4.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_JAZTCPIPV4_H +#define SEABREEZE_JAZTCPIPV4_H + +#include "common/buses/network/TCPIPv4SocketBus.h" + +namespace seabreeze { + class JazTCPIPv4 : public TCPIPv4SocketBus { + public: + JazTCPIPv4(); + virtual ~JazTCPIPv4(); + + virtual bool open(); + virtual void close(); + }; +} + +#endif /* SEABREEZE_JAZTCPIPV4_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/rs232/OOIRS232Interface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/rs232/OOIRS232Interface.h new file mode 100644 index 0000000..885ba18 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/rs232/OOIRS232Interface.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file OOIRS232Interface.h + * @date April 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIRS232INTERFACE_H +#define OOIRS232INTERFACE_H + +#include "common/buses/rs232/RS232Interface.h" +#include "common/protocols/ProtocolHint.h" +#include "common/buses/TransferHelper.h" + +namespace seabreeze { + + class OOIRS232Interface : public RS232Interface { + public: + OOIRS232Interface(); + virtual ~OOIRS232Interface(); + + /* Inherited from Bus */ + virtual TransferHelper *getHelper(const std::vector &hints) const; + virtual void setLocation(const DeviceLocatorInterface &location) throw (IllegalArgumentException); + virtual bool open(); + virtual void close(); + + protected: + TransferHelper *rs232Helper; + + int baudRate; + }; + +} + +#endif /* OOIRS232INTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/ApexUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/ApexUSB.h new file mode 100644 index 0000000..82ee675 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/ApexUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file ApexUSB.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 APEXUSB_H +#define APEXUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class ApexUSB : public OOIUSBInterface { + public: + ApexUSB(); + virtual ~ApexUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* APEXUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSB.h new file mode 100644 index 0000000..0c10e68 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file BlazeUSB.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 BLAZEUSB_H +#define BLAZEUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class BlazeUSB : public OOIUSBInterface { + public: + BlazeUSB(); + virtual ~BlazeUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* BLAZEUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSBTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSBTransferHelper.h new file mode 100644 index 0000000..8a915b6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/BlazeUSBTransferHelper.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file BlazeUSBTransferHelper.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * This class encapsulates the behavior of the USB4000 and HR4000 + * in the case where they are connected via a USB2.0 bus. For the + * case where the device is connected via USB 1.1, then the + * OOIUSBSpectrumTransferHelper should be used instead. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 BLAZEUSBTRANSFERHELPER_H +#define BLAZEUSBTRANSFERHELPER_H + +#include "common/buses/usb/USBTransferHelper.h" +#include "vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h" + +namespace seabreeze { + + class BlazeUSBTransferHelper : public USBTransferHelper { + public: + BlazeUSBTransferHelper(USB *usb, + const OOIUSBBidrectionalEndpointMap &map); + virtual ~BlazeUSBTransferHelper(); + + /* Inherited */ + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException); + virtual int send(const std::vector &buffer, unsigned int length) const + throw (BusTransferException); + + private: + static const int WORD_SIZE_BYTES; + }; + +} + +#endif /* BLAZEUSBTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/FlameNIRUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/FlameNIRUSB.h new file mode 100644 index 0000000..1312f92 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/FlameNIRUSB.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file FlameNIRUSB.h + * @date Apr 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 FLAMENIRUSB_H +#define FLAMENIRUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class FlameNIRUSB : public OOIUSBInterface { + public: + FlameNIRUSB(); + virtual ~FlameNIRUSB(); + + virtual bool open(); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000PlusUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000PlusUSB.h new file mode 100644 index 0000000..c52d326 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000PlusUSB.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file HR2000PlusUSB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000PLUSUSB_H +#define HR2000PLUSUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class HR2000PlusUSB : public OOIUSBInterface { + public: + HR2000PlusUSB(); + virtual ~HR2000PlusUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + + }; + +} + +#endif /* HR2000PLUSUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000USB.h new file mode 100644 index 0000000..d1642cf --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR2000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file HR2000USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000USB_H +#define HR2000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class HR2000USB : public OOIUSBInterface { + public: + HR2000USB(); + virtual ~HR2000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* HR2000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR4000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR4000USB.h new file mode 100644 index 0000000..78a8413 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/HR4000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file HR4000USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR4000USB_H +#define HR4000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class HR4000USB : public OOIUSBInterface { + public: + HR4000USB(); + virtual ~HR4000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* HR4000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/JazUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/JazUSB.h new file mode 100644 index 0000000..db03827 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/JazUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file JazUSB.h + * @date November 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 JAZUSB_H +#define JAZUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class JazUSB : public OOIUSBInterface { + public: + JazUSB(); + virtual ~JazUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* JAZUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000ProUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000ProUSB.h new file mode 100644 index 0000000..95195f6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000ProUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Maya2000ProUSB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000PROUSB_H +#define MAYA2000PROUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class Maya2000ProUSB : public OOIUSBInterface { + public: + Maya2000ProUSB(); + virtual ~Maya2000ProUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* MAYA2000PROUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000USB.h new file mode 100644 index 0000000..2c3163f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/Maya2000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Maya2000USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000USB_H +#define MAYA2000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class Maya2000USB : public OOIUSBInterface { + public: + Maya2000USB(); + virtual ~Maya2000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* MAYA2000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/MayaLSLUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/MayaLSLUSB.h new file mode 100644 index 0000000..bbeef85 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/MayaLSLUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file MayaLSLUSB.h + * @date 13-Jan-2015 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYALSLUSB_H +#define MAYALSLUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class MayaLSLUSB : public OOIUSBInterface { + public: + MayaLSLUSB(); + virtual ~MayaLSLUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* MAYALSLUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest256USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest256USB.h new file mode 100644 index 0000000..5aefeed --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest256USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file NIRQuest256USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST256USB_H +#define NIRQUEST256USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class NIRQuest256USB : public OOIUSBInterface { + public: + NIRQuest256USB(); + virtual ~NIRQuest256USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* NIRQUEST256USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest512USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest512USB.h new file mode 100644 index 0000000..c9b587f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/NIRQuest512USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file NIRQuest512USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST512USB_H +#define NIRQUEST512USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class NIRQuest512USB : public OOIUSBInterface { + public: + NIRQuest512USB(); + virtual ~NIRQuest512USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* NIRQUEST512USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSB4KSpectrumTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSB4KSpectrumTransferHelper.h new file mode 100644 index 0000000..e7be862 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSB4KSpectrumTransferHelper.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file OOIUSB4KSpectrumTransferHelper.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This class encapsulates the behavior of the USB4000 and HR4000 + * in the case where they are connected via a USB2.0 bus. For the + * case where the device is connected via USB 1.1, then the + * OOIUSBSpectrumTransferHelper should be used instead. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSB4KSPECTRUMTRANSFERHELPER_H +#define OOIUSB4KSPECTRUMTRANSFERHELPER_H + +#include "common/buses/usb/USBTransferHelper.h" +#include "vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h" + +namespace seabreeze { + + class OOIUSB4KSpectrumTransferHelper : public USBTransferHelper { + public: + OOIUSB4KSpectrumTransferHelper(USB *usb, + const OOIUSBCypressEndpointMap &map); + virtual ~OOIUSB4KSpectrumTransferHelper(); + + /* Inherited */ + virtual int receive(std::vector &buffer, unsigned int length) + throw (BusTransferException); + + private: + int secondaryHighSpeedEP; + std::vector primaryReadBuffer; + std::vector secondaryReadBuffer; + }; + +} + +#endif /* OOIUSB4KSPECTRUMTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBControlTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBControlTransferHelper.h new file mode 100644 index 0000000..9a9564c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBControlTransferHelper.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OOIUSBControlTransferHelper.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBCONTROLTRANSFERHELPER_H +#define OOIUSBCONTROLTRANSFERHELPER_H + +#include "common/buses/usb/USBTransferHelper.h" +#include "vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h" + +namespace seabreeze { + + class OOIUSBControlTransferHelper : public USBTransferHelper { + public: + OOIUSBControlTransferHelper(USB *usb, + const OOIUSBCypressEndpointMap &map); + virtual ~OOIUSBControlTransferHelper(); + }; + +} + +#endif /* OOIUSBCONTROLTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h new file mode 100644 index 0000000..a0b8290 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h @@ -0,0 +1,123 @@ +/***************************************************//** + * @file OOIUSBEndpointMaps.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBENDPOINTMAPS_H +#define OOIUSBENDPOINTMAPS_H + +namespace seabreeze { + + class OOIUSBCypressEndpointMap { + public: + int getLowSpeedInEP() const; + int getLowSpeedOutEP() const; + int getHighSpeedInEP() const; + int getHighSpeedIn2EP() const; + + protected: + int lowSpeedIn; + int lowSpeedOut; + int highSpeedIn; + int highSpeedIn2; + }; + + /* This map is appropriate for the following spectrometers: + * USB2000 (and its variants), HR2000, ADC1000-USB, + * NIR256, NIR512, SAS + */ + class OOIUSBLegacy2KEndpointMap : public OOIUSBCypressEndpointMap { + public: + OOIUSBLegacy2KEndpointMap(); + virtual ~OOIUSBLegacy2KEndpointMap(); + + }; + + /* This map is appropriate for the following spectrometers: + * HR2000+, HR4000, Maya, Maya2000Pro, MayaLSL, QE65000, USB2000+, USB4000 + */ + class OOIUSBFPGAEndpointMap : public OOIUSBCypressEndpointMap { + public: + OOIUSBFPGAEndpointMap(); + virtual ~OOIUSBFPGAEndpointMap(); + + }; + + class OOIUSBJazEndpointMap : public OOIUSBCypressEndpointMap { + public: + OOIUSBJazEndpointMap(); + virtual ~OOIUSBJazEndpointMap(); + }; + + /* This defines a simple interface for an endpoint map that has a one input + * and one output endpoint. + */ + class OOIUSBBidrectionalEndpointMap { + public: + OOIUSBBidrectionalEndpointMap(); + virtual ~OOIUSBBidrectionalEndpointMap(); + virtual int getPrimaryInEndpoint() const; + virtual int getPrimaryOutEndpoint() const; + protected: + int primaryInEndpoint; + int primaryOutEndpoint; + }; + + /* This map is appropriate for the following spectrometers: + * Ventana + */ + class OOIUSBVentanaEndpointMap : public OOIUSBBidrectionalEndpointMap { + public: + OOIUSBVentanaEndpointMap(); + virtual ~OOIUSBVentanaEndpointMap(); + }; + + class OOIUSBDualBidirectionalEndpointMap : public OOIUSBBidrectionalEndpointMap { + public: + OOIUSBDualBidirectionalEndpointMap(); + virtual ~OOIUSBDualBidirectionalEndpointMap(); + int getSecondaryInEndpoint() const; + int getSecondaryOutEndpoint() const; + + protected: + int secondaryInEndpoint; + int secondaryOutEndpoint; + }; + + /* This map is appropriate for the following spectrometers: + * STS, QEPro + */ + class OOIUSBSimpleDualEndpointMap : public OOIUSBDualBidirectionalEndpointMap { + public: + OOIUSBSimpleDualEndpointMap(); + virtual ~OOIUSBSimpleDualEndpointMap(); + }; + +} + + +#endif /* OOIUSBENDPOINTMAPS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBInterface.h new file mode 100644 index 0000000..f6e84cc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBInterface.h @@ -0,0 +1,76 @@ +/***************************************************//** + * @file OOIUSBInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBINTERFACE_H +#define OOIUSBINTERFACE_H + +#include "common/buses/usb/USBInterface.h" +#include "common/protocols/ProtocolHint.h" +#include "common/buses/TransferHelper.h" +#include "common/buses/DeviceLocationProberInterface.h" + +#define OCEAN_OPTICS_USB_VID 0x2457 + +namespace seabreeze { + + class OOIUSBInterface : public USBInterface, public DeviceLocationProberInterface { + public: + OOIUSBInterface(); + virtual ~OOIUSBInterface(); + + int getProductID(); + int getVendorID(); + + /* Inherited from Bus */ + virtual TransferHelper *getHelper(const std::vector &hints) const; + virtual void setLocation(const DeviceLocatorInterface &location) throw (IllegalArgumentException); + virtual bool open(); + virtual void close(); + + /* Inherited from DeviceLocationProberInterface */ + virtual std::vector *probeDevices(); + + protected: + void addHelper(ProtocolHint *hint, TransferHelper *helper); + void clearHelpers(); + + int vendorID; + int productID; + + /* These vectors should really be in a map, but that didn't want to + * work easily. Since there will likely be about 2 entries in here, + * storing in a pair of vectors for now won't hurt anything. + */ + std::vector helperKeys; + std::vector helperValues; + }; + +} + +#endif /* OOIUSBINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBProductID.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBProductID.h new file mode 100644 index 0000000..996ad15 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBProductID.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file OOIUSBProductID.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBPRODUCTID_H +#define OOIUSBPRODUCTID_H + +#define USB2000_USB_PID 0x1002 +#define HR2000_USB_PID 0x100a +#define HR4000_USB_PID 0x1012 +#define HR2000PLUS_USB_PID 0x1016 +#define QE65000_USB_PID 0x1018 +#define USB2000PLUS_USB_PID 0x101E +#define USB4000_USB_PID 0x1022 +#define NIRQUEST512_USB_PID 0x1026 +#define NIRQUEST256_USB_PID 0x1028 +#define MAYA2000PRO_USB_PID 0x102a +#define MAYA2000_USB_PID 0x102c +#define MAYALSL_USB_PID 0x1046 +#define TORUS_USB_PID 0x1040 +#define APEX_USB_PID 0x1044 +#define FLAMENIR_USB_PID 0x104b +#define JAZ_USB_PID 0x2000 +#define BLAZE_USB_PID 0x2001 +#define STS_USB_PID 0x4000 +#define QEPRO_USB_PID 0x4004 +#define SPARK_USB_PID 0x4200 +#define VENTANA_USB_PID 0x5000 +#define GENERIC_SMARTPHONE_MODULE_PID 0x7002 + +#endif /* OOIUSBPRODUCTID_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBSpectrumTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBSpectrumTransferHelper.h new file mode 100644 index 0000000..ff08b12 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBSpectrumTransferHelper.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OOIUSBSpectrumTransferHelper.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBSPECTRUMTRANSFERHELPER_H +#define OOIUSBSPECTRUMTRANSFERHELPER_H + +#include "common/buses/usb/USBTransferHelper.h" +#include "vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h" + +namespace seabreeze { + + class OOIUSBSpectrumTransferHelper : public USBTransferHelper { + public: + OOIUSBSpectrumTransferHelper(USB *usb, + const OOIUSBCypressEndpointMap &map); + virtual ~OOIUSBSpectrumTransferHelper(); + }; + +} + +#endif /* OOIUSBSPECTRUMTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBTrivialTransferHelper.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBTrivialTransferHelper.h new file mode 100644 index 0000000..cb9e897 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/OOIUSBTrivialTransferHelper.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OOIUSBTrivialTransferHelper.h + * @date June 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIUSBTRIVIALTRANSFERHELPER_H +#define OOIUSBTRIVIALTRANSFERHELPER_H + +#include "common/buses/usb/USBTransferHelper.h" +#include "vendors/OceanOptics/buses/usb/OOIUSBEndpointMaps.h" + +namespace seabreeze { + + class OOIUSBTrivialTransferHelper : public USBTransferHelper { + public: + OOIUSBTrivialTransferHelper(USB *usb, const OOIUSBBidrectionalEndpointMap &map); + virtual ~OOIUSBTrivialTransferHelper(); + }; + +} + +#endif /* OOIUSBTRIVIALTRANSFERHELPER_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QE65000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QE65000USB.h new file mode 100644 index 0000000..ef24f1f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QE65000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file QE65000USB.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QE65000USB_H +#define QE65000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class QE65000USB : public OOIUSBInterface { + public: + QE65000USB(); + virtual ~QE65000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* QE65000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QEProUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QEProUSB.h new file mode 100644 index 0000000..a15af3e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/QEProUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file QEProUSB.h + * @date Jane 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QEPROUSB_H +#define QEPROUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class QEProUSB : public OOIUSBInterface { + public: + QEProUSB(); + virtual ~QEProUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* QEPROUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/STSUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/STSUSB.h new file mode 100644 index 0000000..80cc82b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/STSUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file STSUSB.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STSUSB_H +#define STSUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class STSUSB : public OOIUSBInterface { + public: + STSUSB(); + virtual ~STSUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* STSUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/SparkUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/SparkUSB.h new file mode 100644 index 0000000..be188b2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/SparkUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file SparkUSB.h + * @date January 2015 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SPARKUSB_H +#define SPARKUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class SparkUSB : public OOIUSBInterface { + public: + SparkUSB(); + virtual ~SparkUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* SPARKUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/TorusUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/TorusUSB.h new file mode 100644 index 0000000..90b63ef --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/TorusUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file TorusUSB.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 TORUSUSB_H +#define TORUSUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class TorusUSB : public OOIUSBInterface { + public: + TorusUSB(); + virtual ~TorusUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* TORUSUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000PlusUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000PlusUSB.h new file mode 100644 index 0000000..c360985 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000PlusUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB2000PlusUSB.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000PLUSUSB_H +#define USB2000PLUSUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class USB2000PlusUSB : public OOIUSBInterface { + public: + USB2000PlusUSB(); + virtual ~USB2000PlusUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* USB2000PLUSUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000USB.h new file mode 100644 index 0000000..396af57 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB2000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB2000USB.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000USB_H +#define USB2000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class USB2000USB : public OOIUSBInterface { + public: + USB2000USB(); + virtual ~USB2000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* USB2000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB4000USB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB4000USB.h new file mode 100644 index 0000000..09993a3 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/USB4000USB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB4000USB.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB4000USB_H +#define USB4000USB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class USB4000USB : public OOIUSBInterface { + public: + USB4000USB(); + virtual ~USB4000USB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* USB4000USB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/VentanaUSB.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/VentanaUSB.h new file mode 100644 index 0000000..a750f61 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/buses/usb/VentanaUSB.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file VentanaUSB.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENTANAUSB_H +#define VENTANAUSB_H + +#include "vendors/OceanOptics/buses/usb/OOIUSBInterface.h" + +namespace seabreeze { + + class VentanaUSB : public OOIUSBInterface { + public: + VentanaUSB(); + virtual ~VentanaUSB(); + + /* Inherited from OOIUSBInterface */ + virtual bool open(); + }; + +} + +#endif /* STSUSB_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Apex.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Apex.h new file mode 100644 index 0000000..eb3fa31 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Apex.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Apex.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 APEX_H +#define APEX_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Apex : public Device { + public: + Apex(); + virtual ~Apex(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* APEX_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Blaze.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Blaze.h new file mode 100644 index 0000000..20b08d4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Blaze.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Blaze.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 BLAZE_H +#define BLAZE_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Blaze : public Device { + public: + Blaze(); + virtual ~Blaze(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* BLAZE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/FlameNIR.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/FlameNIR.h new file mode 100644 index 0000000..8e19baa --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/FlameNIR.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file FlameNIR.h + * @date Apr 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 FLAMENIR_H +#define FLAMENIR_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class FlameNIR : public Device { + public: + FlameNIR(); + virtual ~FlameNIR(); + + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000.h new file mode 100644 index 0000000..c614cc3 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file HR2000.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000_H +#define HR2000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class HR2000 : public Device { + public: + HR2000(); + virtual ~HR2000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + + }; + +} + +#endif /* HR2000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000Plus.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000Plus.h new file mode 100644 index 0000000..85acf18 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR2000Plus.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file HR2000Plus.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000PLUS_H +#define HR2000PLUS_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class HR2000Plus : public Device { + public: + HR2000Plus(); + virtual ~HR2000Plus(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* HR2000PLUS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR4000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR4000.h new file mode 100644 index 0000000..07d9902 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/HR4000.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file HR4000.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR4000_H +#define HR4000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class HR4000 : public Device { + public: + HR4000(); + virtual ~HR4000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* HR4000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Jaz.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Jaz.h new file mode 100644 index 0000000..3cd3895 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Jaz.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Jaz.h + * @date November 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 JAZ_H +#define JAZ_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Jaz : public Device { + public: + Jaz(); + virtual ~Jaz(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* JAZ_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000.h new file mode 100644 index 0000000..7024bc7 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Maya2000.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000_H +#define MAYA2000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Maya2000 : public Device { + public: + Maya2000(); + virtual ~Maya2000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* MAYA2000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000Pro.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000Pro.h new file mode 100644 index 0000000..45f29aa --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Maya2000Pro.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Maya2000Pro.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000PRO_H +#define MAYA2000PRO_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Maya2000Pro : public Device { + public: + Maya2000Pro(); + virtual ~Maya2000Pro(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* MAYA2000PRO_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/MayaLSL.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/MayaLSL.h new file mode 100644 index 0000000..24d57cc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/MayaLSL.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file MayaLSL.h + * @date 13-Jan-2015 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENDORS_OCEANOPTICS_DEVICES_MAYALSL_H +#define VENDORS_OCEANOPTICS_DEVICES_MAYALSL_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class MayaLSL : public Device { + public: + MayaLSL(); + virtual ~MayaLSL(); + + // Must be overridden from Device + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* VENDORS_OCEANOPTICS_DEVICES_MAYALSL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest256.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest256.h new file mode 100644 index 0000000..ce6dd2c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest256.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file NIRQuest256.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST256_H +#define NIRQUEST256_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class NIRQuest256 : public Device { + public: + NIRQuest256(); + virtual ~NIRQuest256(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* NIRQUEST256_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest512.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest512.h new file mode 100644 index 0000000..8a62761 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/NIRQuest512.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file NIRQuest512.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST512_H +#define NIRQUEST512_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class NIRQuest512 : public Device { + public: + NIRQuest512(); + virtual ~NIRQuest512(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* NIRQUEST512_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QE65000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QE65000.h new file mode 100644 index 0000000..ddd4c1e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QE65000.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file QE65000.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QE65000_H +#define QE65000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class QE65000 : public Device { + public: + QE65000(); + virtual ~QE65000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* QE65000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QEPro.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QEPro.h new file mode 100644 index 0000000..d8bef4d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/QEPro.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file QEPro.h + * @date June 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QEPRO_H +#define QEPRO_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class QEPro : public Device { + public: + QEPro(); + virtual ~QEPro(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* QEPRO_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/STS.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/STS.h new file mode 100644 index 0000000..fad5a7a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/STS.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file STS.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STS_H +#define STS_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class STS : public Device { + public: + STS(); + virtual ~STS(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* STS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Spark.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Spark.h new file mode 100644 index 0000000..ebbf402 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Spark.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Spark.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SPARK_H +#define SPARK_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Spark : public Device { + public: + Spark(); + virtual ~Spark(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* SPARK_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Torus.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Torus.h new file mode 100644 index 0000000..76ace9f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Torus.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file Torus.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 TORUS_H +#define TORUS_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Torus : public Device { + public: + Torus(); + virtual ~Torus(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* TORUS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000.h new file mode 100644 index 0000000..1791d44 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB2000.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000_H +#define USB2000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class USB2000 : public Device { + public: + USB2000(); + virtual ~USB2000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* USB2000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000Plus.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000Plus.h new file mode 100644 index 0000000..aab3a48 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB2000Plus.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB2000Plus.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000PLUS_H +#define USB2000PLUS_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class USB2000Plus : public Device { + public: + USB2000Plus(); + virtual ~USB2000Plus(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* USB2000PLUS_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB4000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB4000.h new file mode 100644 index 0000000..a9edddb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/USB4000.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file USB4000.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB4000_H +#define USB4000_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class USB4000 : public Device { + public: + USB4000(); + virtual ~USB4000(); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* USB4000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Ventana.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Ventana.h new file mode 100644 index 0000000..6bc250b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/devices/Ventana.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file Ventana.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENTANA_H +#define VENTANA_H + +#include "common/devices/Device.h" + +namespace seabreeze { + + class Ventana : public Device { + public: + Ventana(); + virtual ~Ventana(); + + /* Overridden from Device to allow detection of thermoelectric + * capability. + */ + virtual bool initialize(const Bus &bus); + + /* Must be overridden from Device */ + virtual ProtocolFamily getSupportedProtocol(FeatureFamily family, BusFamily bus); + }; + +} + +#endif /* VENTANA_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h new file mode 100644 index 0000000..e0bacf3 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h @@ -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 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 */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeatureInterface.h new file mode 100644 index 0000000..bf7a90a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeatureInterface.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 */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature_FPGA.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature_FPGA.h new file mode 100644 index 0000000..c637ee5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature_FPGA.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 + +namespace seabreeze { + + class AcquisitionDelayFeature_FPGA : public AcquisitionDelayFeature { + public: + AcquisitionDelayFeature_FPGA(std::vector 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 */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/STSAcquisitionDelayFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/STSAcquisitionDelayFeature.h new file mode 100644 index 0000000..c44368e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/STSAcquisitionDelayFeature.h @@ -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 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 */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature.h new file mode 100644 index 0000000..8625b8a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file ContinuousStrobeFeature.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTINUOUS_STROBE_FEATURE_H +#define SEABREEZE_CONTINUOUS_STROBE_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/continuous_strobe/ContinuousStrobeFeatureInterface.h" + +namespace seabreeze { + + class ContinuousStrobeFeature : public FeatureImpl, + public ContinuousStrobeFeatureInterface { + public: + ContinuousStrobeFeature(std::vector helpers); + virtual ~ContinuousStrobeFeature(); + virtual void setContinuousStrobePeriodMicroseconds(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, unsigned long period_usec) + throw (FeatureException); + virtual void setContinuousStrobeEnable(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, bool enable) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + }; +} + +#endif /* SEABREEZE_CONTINUOUS_STROBE_FEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeatureInterface.h new file mode 100644 index 0000000..755c3ca --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeatureInterface.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file ContinuousStrobeFeatureInterface.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTINUOUS_STROBE_FEATURE_INTERFACE_H +#define SEABREEZE_CONTINUOUS_STROBE_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 ContinuousStrobeFeatureInterface { + public: + virtual ~ContinuousStrobeFeatureInterface() = 0; + virtual void setContinuousStrobePeriodMicroseconds(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, unsigned long period_usec) + throw (FeatureException) = 0; + virtual void setContinuousStrobeEnable(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, bool enable) + throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline ContinuousStrobeFeatureInterface::~ContinuousStrobeFeatureInterface() {} +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature_FPGA.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature_FPGA.h new file mode 100644 index 0000000..1bd3c0c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/continuous_strobe/ContinuousStrobeFeature_FPGA.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file ContinuousStrobeFeature_FPGA.h + * @date February 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTINUOUS_STROBE_FEATURE_FPGA_H +#define SEABREEZE_CONTINUOUS_STROBE_FEATURE_FPGA_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/continuous_strobe/ContinuousStrobeFeatureInterface.h" + +namespace seabreeze { + + class ContinuousStrobeFeature_FPGA : public FeatureImpl, + public ContinuousStrobeFeatureInterface { + public: + ContinuousStrobeFeature_FPGA(); + virtual ~ContinuousStrobeFeature_FPGA(); + virtual void setContinuousStrobePeriodMicroseconds(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, unsigned long period_usec) + throw (FeatureException); + virtual void setContinuousStrobeEnable(const Protocol &protocol, + const Bus &bus, unsigned short strobe_id, bool enable) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + }; +} + +#endif /* SEABREEZE_CONTINUOUS_STROBE_FEATURE_FPGA_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureBase.h new file mode 100644 index 0000000..928db97 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureBase.h @@ -0,0 +1,80 @@ +/***************************************************//** + * @file DataBufferFeature.h + * @date October 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 DATABUFFERFEATUREBASE_H +#define DATABUFFERFEATUREBASE_H + +#include + +#include "vendors/OceanOptics/features/data_buffer/DataBufferFeatureInterface.h" +#include "common/features/FeatureImpl.h" + +namespace seabreeze { + + class DataBufferFeatureBase : public FeatureImpl, public DataBufferFeatureInterface { + public: + DataBufferFeatureBase(); + virtual ~DataBufferFeatureBase(); + + virtual DataBufferCount_t getNumberOfBuffers(); + virtual void clearBuffer(const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) + throw (FeatureException); + virtual DataBufferElementCount_t getNumberOfElements( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) + throw (FeatureException); + virtual DataBufferElementCount_t getBufferCapacity( + const Protocol &protocol, + const Bus &bus, const DataBufferIndex_t bufferIndex) + throw (FeatureException); + virtual DataBufferElementCount_t getBufferCapacityMinimum( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) + throw (FeatureException); + virtual DataBufferElementCount_t getBufferCapacityMaximum( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) + throw (FeatureException); + virtual void setBufferCapacity(const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex, + const DataBufferElementCount_t bufferSize) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + protected: + DataBufferIndex_t numberOfBuffers; + }; + +} /* end namespace */ + +#endif /* DATABUFFERFEATUREBASE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureInterface.h new file mode 100644 index 0000000..2b086e4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/DataBufferFeatureInterface.h @@ -0,0 +1,75 @@ +/***************************************************//** + * @file DataBufferFeatureInterface.h + * @date October 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 DATABUFFERFEATUREINTERFACE_H +#define DATABUFFERFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + typedef unsigned char DataBufferIndex_t; + typedef DataBufferIndex_t DataBufferCount_t; + typedef unsigned long DataBufferElementCount_t; + + class DataBufferFeatureInterface { + public: + virtual ~DataBufferFeatureInterface() = 0; + + virtual DataBufferCount_t getNumberOfBuffers() = 0; + virtual void clearBuffer(const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) throw (FeatureException) = 0; + virtual DataBufferElementCount_t getBufferCapacity(const Protocol &protocol, + const Bus &bus, const DataBufferIndex_t bufferIndex) + throw (FeatureException) = 0; + virtual DataBufferElementCount_t getBufferCapacityMaximum( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) throw (FeatureException) = 0; + virtual DataBufferElementCount_t getBufferCapacityMinimum( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) throw (FeatureException) = 0; + virtual DataBufferElementCount_t getNumberOfElements( + const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex) throw (FeatureException) = 0; + virtual void setBufferCapacity(const Protocol &protocol, const Bus &bus, + const DataBufferIndex_t bufferIndex, + const DataBufferElementCount_t bufferSize) + throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline DataBufferFeatureInterface::~DataBufferFeatureInterface() {} + +} /* end namespace */ + + +#endif /* DATABUFFERFEATUREINTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/QEProDataBufferFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/QEProDataBufferFeature.h new file mode 100644 index 0000000..c9ad005 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/data_buffer/QEProDataBufferFeature.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file QEProDataBufferFeature.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the spectral + * data buffer in the QE-PRO. + * + * 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 QEPRODATABUFFERFEATURE_H +#define QEPRODATABUFFERFEATURE_H + +#include "vendors/OceanOptics/features/data_buffer/DataBufferFeatureBase.h" + +namespace seabreeze { + + class QEProDataBufferFeature : public DataBufferFeatureBase { + public: + QEProDataBufferFeature(); + virtual ~QEProDataBufferFeature(); + }; + +} /* end namespace */ + +#endif /* QEPRODATABUFFERFEATURE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeature.h new file mode 100644 index 0000000..4de6785 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeature.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file EEPROMSlotFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 EEPROMSLOTFEATURE_H +#define EEPROMSLOTFEATURE_H + +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureInterface.h" +#include + +namespace seabreeze { + + class EEPROMSlotFeature : public EEPROMSlotFeatureBase, public EEPROMSlotFeatureInterface { + public: + EEPROMSlotFeature(unsigned int numberOfSlots); + virtual ~EEPROMSlotFeature(); + virtual std::vector< std::vector * > *readAllEEPROMSlots(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding this to change its visibility */ + virtual std::vector *readEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot) throw (FeatureException, IllegalArgumentException); + virtual int writeEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot, const std::vector &data) + throw (FeatureException, IllegalArgumentException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + private: + unsigned int numberOfSlots; + }; + +} + +#endif /* EEPROMSLOTFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h new file mode 100644 index 0000000..9c274e1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h @@ -0,0 +1,75 @@ +/***************************************************//** + * @file EEPROMSlotFeatureBase.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 EEPROMSLOTFEATUREBASE_H +#define EEPROMSLOTFEATUREBASE_H + +#include "common/features/FeatureImpl.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/SeaBreeze.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/NumberFormatException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include + +namespace seabreeze { + + class EEPROMSlotFeatureBase : public FeatureImpl { + /* Keeping most of this class protected to force use of the derived + * classes, e.g. EEPROMSlotFeature, which can provide better control + * over which slots are accessed. + */ + + protected: + + EEPROMSlotFeatureBase(); + virtual ~EEPROMSlotFeatureBase(); + virtual std::vector *readEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot) throw (FeatureException, IllegalArgumentException); + virtual int writeEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot, const std::vector &data) + throw (FeatureException, IllegalArgumentException); + + /* This is a utility function that reads out the given EEPROM slot and + * parses it into a double value. If for some reason the parse fails, + * this will throw a NumberFormatException. + */ + double readDouble(const Protocol &protocol, const Bus &bus, + unsigned int slot) throw (FeatureException, NumberFormatException); + + /* As with readDouble(), this will read a slot and parse into an integer */ + long readLong(const Protocol &protocol, const Bus &bus, + unsigned int slot) throw (FeatureException, NumberFormatException); + + }; + +} + +#endif /* EEPROMSLOTFEATUREBASE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureInterface.h new file mode 100644 index 0000000..7a5f3dc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureInterface.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file EEPROMSlotFeature.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 EEPROMSLOTFEATUREINTERFACE_H +#define EEPROMSLOTFEATUREINTERFACE_H + +#include +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class EEPROMSlotFeatureInterface { + public: + virtual ~EEPROMSlotFeatureInterface() = 0; + virtual std::vector< std::vector * > *readAllEEPROMSlots(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + virtual std::vector *readEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot) throw (FeatureException, IllegalArgumentException) = 0; + virtual int writeEEPROMSlot(const Protocol &protocol, + const Bus &bus, unsigned int slot, const std::vector &data) + throw (FeatureException, IllegalArgumentException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline EEPROMSlotFeatureInterface::~EEPROMSlotFeatureInterface() {} + +} + +#endif /* EEPROMSLOTFEATUREINTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/NonlinearityEEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/NonlinearityEEPROMSlotFeature.h new file mode 100644 index 0000000..db8e6be --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/NonlinearityEEPROMSlotFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file NonlinearityEEPROMSlotFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NONLINEARITYEEPROMSLOTFEATURE_H +#define NONLINEARITYEEPROMSLOTFEATURE_H + +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" +#include "vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include + +namespace seabreeze { + + class NonlinearityEEPROMSlotFeature + : public NonlinearityCoeffsFeatureInterface, public EEPROMSlotFeatureBase { + public: + NonlinearityEEPROMSlotFeature(); + virtual ~NonlinearityEEPROMSlotFeature(); + std::vector *readNonlinearityCoefficients(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* NONLINEARITYEEPROMSLOTFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature.h new file mode 100644 index 0000000..5fa8fd6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file SaturationEEPROMSlotFeature_EEPROM.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 SATURATIONEEPROMSLOTFEATURE_EEPROM_H +#define SATURATIONEEPROMSLOTFEATURE_EEPROM_H + +#include "vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h" + +namespace seabreeze { + + /* This class is intended for most devices that store their saturation level + * in EEPROM in the so-called "autonulling" configuration. Note that the + * NIRQuest, MayaPro, Apex and some others do not do things quite the same + * way, so they should not use this class. + */ + class SaturationEEPROMSlotFeature + : public SaturationEEPROMSlotFeatureBase { + public: + SaturationEEPROMSlotFeature(int slot); + virtual ~SaturationEEPROMSlotFeature(); + + protected: + /* Inherited from SaturationEEPROMSlotFeatureBase */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + int autonullingSlot; + }; + +} /* end namespace seabreeze */ + +#endif /* SATURATIONEEPROMSLOTFEATURE_EEPROM_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h new file mode 100644 index 0000000..a56ab41 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h @@ -0,0 +1,67 @@ +/***************************************************//** + * @file SaturationEEPROMSlotFeatureBase.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 SATURATIONEEPROMSLOTFEATUREBASE_H +#define SATURATIONEEPROMSLOTFEATUREBASE_H + +#include "vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureBase.h" +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" + +namespace seabreeze { + + class SaturationEEPROMSlotFeatureBase + : public EEPROMSlotFeatureBase, public ProgrammableSaturationFeatureBase { + public: + SaturationEEPROMSlotFeatureBase(); + virtual ~SaturationEEPROMSlotFeatureBase(); + + /* Inherited from ProgrammableSaturationFeature */ + virtual unsigned int getSaturation() throw (FeatureException); + + /* Inherited from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + virtual FeatureFamily getFeatureFamily(); + + protected: + /* Derived classes must implement this in whatever way is appropriate + * to get the saturation level for the device. + */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + private: + unsigned int saturation; + bool valid; + }; + +} /* end namespace seabreeze */ + +#endif /* SATURATIONEEPROMSLOTFEATUREBASE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_MayaPro.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_MayaPro.h new file mode 100644 index 0000000..5caf4c5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_MayaPro.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file SaturationEEPROMSlotFeature_MayaPro.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 SATURATIONEEPROMSLOTFEATURE_MAYAPRO_H +#define SATURATIONEEPROMSLOTFEATURE_MAYAPRO_H + +#include "vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h" +#include + +namespace seabreeze { + + /* This class is intended specifically for getting the saturation level + * from a MayaPro or devices that are closely related to it. + */ + class SaturationEEPROMSlotFeature_MayaPro + : public SaturationEEPROMSlotFeatureBase { + public: + SaturationEEPROMSlotFeature_MayaPro(int slot); + virtual ~SaturationEEPROMSlotFeature_MayaPro(); + + protected: + /* Inherited from SaturationEEPROMSlotFeatureBase */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + int saturationSlot; + }; + +} /* end namespace seabreeze */ + +#endif /* SATURATIONEEPROMSLOTFEATURE_MAYAPRO_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_NIRQuest.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_NIRQuest.h new file mode 100644 index 0000000..f13391d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeature_NIRQuest.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file SaturationEEPROMSlotFeature_NIRQuest.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 SATURATIONEEPROMSLOTFEATURE_NIRQUEST_H +#define SATURATIONEEPROMSLOTFEATURE_NIRQUEST_H + +#include "vendors/OceanOptics/features/eeprom_slots/SaturationEEPROMSlotFeatureBase.h" +#include + +namespace seabreeze { + + /* This class is intended specifically for getting the saturation level + * from a NIRQuest256/512. No other devices should use this class. + */ + class SaturationEEPROMSlotFeature_NIRQuest + : public SaturationEEPROMSlotFeatureBase { + public: + SaturationEEPROMSlotFeature_NIRQuest(int slot); + virtual ~SaturationEEPROMSlotFeature_NIRQuest(); + + protected: + /* Inherited from SaturationEEPROMSlotFeatureBase */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + int saturationSlot; + }; + +} /* end namespace seabreeze */ + +#endif /* SATURATIONEEPROMSLOTFEATURE_NIRQUEST_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SerialNumberEEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SerialNumberEEPROMSlotFeature.h new file mode 100644 index 0000000..3464d9d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/SerialNumberEEPROMSlotFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file SerialNumberEEPROMSlotFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SERIALNUMBEREEPROMSLOTFEATURE_H +#define SERIALNUMBEREEPROMSLOTFEATURE_H + +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" +#include "vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h" +#include + +namespace seabreeze { + + class SerialNumberEEPROMSlotFeature + : public EEPROMSlotFeatureBase, public SerialNumberFeatureInterface { + public: + SerialNumberEEPROMSlotFeature(); + virtual ~SerialNumberEEPROMSlotFeature(); + std::string *readSerialNumber(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + unsigned char readSerialNumberMaximumLength(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* SERIALNUMBEREEPROMSLOTFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/StrayLightEEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/StrayLightEEPROMSlotFeature.h new file mode 100644 index 0000000..f9bfa70 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/StrayLightEEPROMSlotFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file StrayLightEEPROMSlotFeature.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STRAYLIGHTEEPROMSLOTFEATURE_H +#define STRAYLIGHTEEPROMSLOTFEATURE_H + +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" +#include "vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include + +namespace seabreeze { + + class StrayLightEEPROMSlotFeature + : public StrayLightCoeffsFeatureInterface, public EEPROMSlotFeatureBase { + public: + StrayLightEEPROMSlotFeature(); + virtual ~StrayLightEEPROMSlotFeature(); + std::vector *readStrayLightCoefficients(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* STRAYLIGHTEEPROMSLOTFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature.h new file mode 100644 index 0000000..a256bff --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file WavelengthEEPROMSlotFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 WAVELENGTHEEPROMSLOTFEATURE_H +#define WAVELENGTHEEPROMSLOTFEATURE_H + +#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeatureBase.h" +#include "vendors/OceanOptics/features/wavecal/WaveCalFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include + +namespace seabreeze { + + class WavelengthEEPROMSlotFeature + : public WaveCalFeatureInterface, public EEPROMSlotFeatureBase { + public: + WavelengthEEPROMSlotFeature(unsigned int numberOfPixels); + virtual ~WavelengthEEPROMSlotFeature(); + std::vector *readWavelengths(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + protected: + virtual std::vector *computeWavelengths( + double polynomial[], int length); + unsigned int numberOfPixels; + }; + +} + +#endif /* WAVELENGTHEEPROMSLOTFEATURE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature_QE65000.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature_QE65000.h new file mode 100644 index 0000000..a586359 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature_QE65000.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file WavelengthEEPROMSlotFeature_QE65000.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 WAVELENGTHEEPROMSLOTFEATUREQE65000_H +#define WAVELENGTHEEPROMSLOTFEATUREQE65000_H + +#include "vendors/OceanOptics/features/eeprom_slots/WavelengthEEPROMSlotFeature.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include + +namespace seabreeze { + + class WavelengthEEPROMSlotFeature_QE65000 + : public WavelengthEEPROMSlotFeature { + public: + WavelengthEEPROMSlotFeature_QE65000(unsigned int numberOfPixels); + virtual ~WavelengthEEPROMSlotFeature_QE65000(); + + protected: + /* Overriding from WavelengthEEPROMSlotFeature */ + virtual std::vector *computeWavelengths(double polynomial[], + int length); + }; + +} + +#endif /* WAVELENGTHEEPROMSLOTFEATUREQE65000_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeature.h new file mode 100644 index 0000000..a29c8bc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeature.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file FPGARegisterFeature.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_FEATURE_H +#define SEABREEZE_FPGA_REGISTER_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/fpga_register/FPGARegisterFeatureInterface.h" + +namespace seabreeze { + + class FPGARegisterFeature : public FeatureImpl, public FPGARegisterFeatureInterface { + public: + FPGARegisterFeature(); + virtual ~FPGARegisterFeature(); + virtual unsigned int readRegister(const Bus &bus, byte address) + throw (FeatureException); + virtual void writeRegister(const Bus &bus, byte address, unsigned int value) + throw (FeatureException); + virtual unsigned char getMajorVersion(const Bus &bus) + throw (FeatureException); + + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeatureInterface.h new file mode 100644 index 0000000..54fa0bc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/fpga_register/FPGARegisterFeatureInterface.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file FPGARegisterFeatureInterface.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_FEATURE_INTERFACE_H +#define SEABREEZE_FPGA_REGISTER_FEATURE_INTERFACE_H + +#include "common/features/Feature.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class FPGARegisterFeatureInterface { + public: + virtual ~FPGARegisterFeatureInterface() = 0; + virtual unsigned int readRegister(const Bus &bus, byte address) + throw (FeatureException) = 0; + virtual void writeRegister(const Bus &bus, byte address, unsigned int value) + throw (FeatureException) = 0; + virtual unsigned char getMajorVersion(const Bus &bus) + throw (FeatureException) = 0; + }; + + inline FPGARegisterFeatureInterface::~FPGARegisterFeatureInterface() {} +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeature.h new file mode 100644 index 0000000..b85a3c6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeature.h @@ -0,0 +1,71 @@ +/***************************************************//** + * @file IrradCalFeature.h + * @date March 2010 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the + * irradiance calibration storage available on some + * devices (such as the USB2000+). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 IRRADCALFEATURE_H +#define IRRADCALFEATURE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/exceptions/FeatureException.h" +#include "common/FloatVector.h" +#include "vendors/OceanOptics/features/irradcal/IrradCalFeatureInterface.h" + +namespace seabreeze { + + class IrradCalFeature : public FeatureImpl, public IrradCalFeatureInterface { + public: + IrradCalFeature(std::vector helpers, int numPixels); + virtual ~IrradCalFeature(); + virtual std::vector *readIrradCalibration(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual int writeIrradCalibration(const Protocol &protocol, + const Bus &bus, const std::vector &values) throw (FeatureException); + int getNumberOfPixels(); + virtual int hasCollectionArea(const Protocol &protocol, + const Bus &bus); + virtual double readCollectionArea(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual void writeCollectionArea(const Protocol &protocol, + const Bus &bus, double area) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + private: + int numberOfPixels; + }; + +} + +#endif /* IRRADCALFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeatureInterface.h new file mode 100644 index 0000000..5805481 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/irradcal/IrradCalFeatureInterface.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file IrradCalFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the + * irradiance calibration storage available on some + * devices (such as the USB2000+). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 IRRADCALFEATUREINTERFACE_H +#define IRRADCALFEATUREINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class IrradCalFeatureInterface { + public: + virtual ~IrradCalFeatureInterface() = 0; + virtual std::vector *readIrradCalibration(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual int writeIrradCalibration(const Protocol &protocol, + const Bus &bus, const std::vector &values) throw (FeatureException) = 0; + virtual int hasCollectionArea(const Protocol &protocol, + const Bus &bus) = 0; + virtual double readCollectionArea(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual void writeCollectionArea(const Protocol &protocol, + const Bus &bus, double area) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline IrradCalFeatureInterface::~IrradCalFeatureInterface() {} +} + +#endif /* IRRADCALFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureBase.h new file mode 100644 index 0000000..c114c34 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureBase.h @@ -0,0 +1,76 @@ +/***************************************************//** + * @file LightSourceFeatureBase.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 LIGHTSOURCEFEATUREBASE_H +#define LIGHTSOURCEFEATUREBASE_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/light_source/LightSourceFeatureInterface.h" + +namespace seabreeze { + + class LightSourceFeatureBase : public FeatureImpl, + public LightSourceFeatureInterface { + public: + LightSourceFeatureBase(std::vector helpers, int lampModuleIndex); + virtual ~LightSourceFeatureBase(); + + /* Enable controls */ + virtual bool hasLightSourceEnable(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException); + + virtual bool isLightSourceEnabled(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException); + + virtual void setLightSourceEnable(const Protocol &protocol, + const Bus &bus, int lightSourceIndex, bool enable) throw (FeatureException); + + /* Intensity controls */ + virtual bool hasVariableIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException); + + virtual double getLightSourceIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException); + + virtual void setLightSourceIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex, double intensity) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + protected: + int moduleIndex; + }; + +} + +#endif /* LIGHTSOURCEFEATUREBASE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureImpl.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureImpl.h new file mode 100644 index 0000000..cc94855 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureImpl.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file LightSourceFeatureImpl.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * This is a trivial implementation of LightSourceFeatureInterface + * that can manage a single module with one or more light sources + * (e.g. light bulbs, lasers, LEDs). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 LIGHTSOURCEFEATUREIMPL_H +#define LIGHTSOURCEFEATUREIMPL_H + +#include "vendors/OceanOptics/features/light_source/LightSourceFeatureBase.h" + +namespace seabreeze { + + class LightSourceFeatureImpl : public LightSourceFeatureBase { + public: + LightSourceFeatureImpl(std::vector helpers, + int lampModuleIndex, int lightSources); + virtual ~LightSourceFeatureImpl(); + + /* Override from LightSourceFeatureBase */ + virtual int getLightSourceCount(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + protected: + int lightSourceCount; + }; + +} + +#endif /* LIGHTSOURCEFEATUREIMPL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureInterface.h new file mode 100644 index 0000000..4a96948 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/LightSourceFeatureInterface.h @@ -0,0 +1,72 @@ +/***************************************************//** + * @file LightSourceFeatureInterface.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 LIGHTSOURCEFEATUREINTERFACE_H +#define LIGHTSOURCEFEATUREINTERFACE_H + +#include "common/features/Feature.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class LightSourceFeatureInterface { + public: + virtual ~LightSourceFeatureInterface() = 0; + + virtual int getLightSourceCount(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + virtual bool hasLightSourceEnable(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException) = 0; + + virtual bool isLightSourceEnabled(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException) = 0; + + virtual void setLightSourceEnable(const Protocol &protocol, + const Bus &bus, int lightSourceIndex, bool enable) throw (FeatureException) = 0; + + virtual bool hasVariableIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException) = 0; + + virtual double getLightSourceIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex) throw (FeatureException) = 0; + + virtual void setLightSourceIntensity(const Protocol &protocol, + const Bus &bus, int lightSourceIndex, double intensity) throw (FeatureException) = 0; + + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline LightSourceFeatureInterface::~LightSourceFeatureInterface() {} + +} + +#endif /* LIGHTSOURCEFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeature.h new file mode 100644 index 0000000..7f3be9d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file StrobeLampFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STROBELAMPFEATURE_H +#define STROBELAMPFEATURE_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/light_source/StrobeLampFeatureInterface.h" + +namespace seabreeze { + + class StrobeLampFeature : public FeatureImpl, public StrobeLampFeatureInterface { + public: + StrobeLampFeature(std::vector helpers); + virtual ~StrobeLampFeature(); + virtual void setStrobeLampEnable(const Protocol &protocol, + const Bus &bus, bool enable) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + }; + +} + +#endif /* STROBELAMPFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeatureInterface.h new file mode 100644 index 0000000..b2d7df5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/StrobeLampFeatureInterface.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file StrobeLampFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STROBELAMPFEATUREINTERFACE_H +#define STROBELAMPFEATUREINTERFACE_H + +#include "common/features/Feature.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class StrobeLampFeatureInterface { + public: + virtual ~StrobeLampFeatureInterface() = 0; + virtual void setStrobeLampEnable(const Protocol &protocol, + const Bus &bus, bool enable) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline StrobeLampFeatureInterface::~StrobeLampFeatureInterface() {} +} + +#endif /* STROBELAMPFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/VentanaLightSourceFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/VentanaLightSourceFeature.h new file mode 100644 index 0000000..5f440b9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/light_source/VentanaLightSourceFeature.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file VentanaLightSourceFeature.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENTANALIGHTSOURCEFEATURE_H +#define VENTANALIGHTSOURCEFEATURE_H + +#include "vendors/OceanOptics/features/light_source/LightSourceFeatureImpl.h" + +namespace seabreeze { + + class VentanaLightSourceFeature : public LightSourceFeatureImpl { + public: + VentanaLightSourceFeature(std::vector helpers); + virtual ~VentanaLightSourceFeature(); + + /* Overriding from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + }; + +} + +#endif /* VENTANALIGHTSOURCEFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeature.h new file mode 100644 index 0000000..997f678 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeature.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file NonlinearityCoeffsFeature.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NONLINEARITYCOEFFSFEATURE_H +#define NONLINEARITYCOEFFSFEATURE_H + +#include + +#include "vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class NonlinearityCoeffsFeature : public FeatureImpl, + public NonlinearityCoeffsFeatureInterface { + public: + NonlinearityCoeffsFeature(std::vector helpers); + virtual ~NonlinearityCoeffsFeature(); + virtual std::vector *readNonlinearityCoefficients(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* NONLINEARITYCOEFFSFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h new file mode 100644 index 0000000..c13f551 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/nonlinearity/NonlinearityCoeffsFeatureInterface.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file NonlinearityCoeffsFeatureInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NONLINEARITYCOEFFSFEATUREINTERFACE_H +#define NONLINEARITYCOEFFSFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class NonlinearityCoeffsFeatureInterface { + public: + virtual ~NonlinearityCoeffsFeatureInterface() = 0; + virtual std::vector *readNonlinearityCoefficients(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline NonlinearityCoeffsFeatureInterface::~NonlinearityCoeffsFeatureInterface() {} +} + +#endif /* NONLINEARITYCOEFFSFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeature.h new file mode 100644 index 0000000..4b1fd6f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeature.h @@ -0,0 +1,70 @@ +/***************************************************//** + * @file OpticalBenchFeature.h + * @date January 2015 + * @author Kirk Clendinning, Heliospecgtra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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 OPTICALBENCHEFEATURE_H +#define OPTICALBENCHEFEATURE_H + +#include + +#include "vendors/OceanOptics/features/optical_bench/OpticalBenchFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class OpticalBenchFeature + : public FeatureImpl, public OpticalBenchFeatureInterface { + public: + OpticalBenchFeature(std::vector helpers); + virtual ~OpticalBenchFeature(); + virtual unsigned short int readOpticalBenchFiberDiameterMicrons(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual unsigned short int readOpticalBenchSlitWidthMicrons(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual std::string *readOpticalBenchID(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual std::string *readOpticalBenchSerialNumber(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual std::string *readOpticalBenchCoating(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual std::string *readOpticalBenchFilter(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual std::string *readOpticalBenchGrating(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* OPTICALBENCHEFEATURE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeatureInterface.h new file mode 100644 index 0000000..b42389a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/optical_bench/OpticalBenchFeatureInterface.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file OpticalBenchFeatureInterface.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OPTICALBENCHFEATUREINTERFACE_H +#define OPTICALBENCHFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class OpticalBenchFeatureInterface { + public: + virtual ~OpticalBenchFeatureInterface() = 0; + virtual unsigned short int readOpticalBenchFiberDiameterMicrons(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual unsigned short int readOpticalBenchSlitWidthMicrons(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readOpticalBenchID(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readOpticalBenchSerialNumber(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readOpticalBenchCoating(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readOpticalBenchFilter(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readOpticalBenchGrating(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline OpticalBenchFeatureInterface::~OpticalBenchFeatureInterface() {} +} + +#endif /* OPTICALBENCHFEATUREINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/PixelBinningFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/PixelBinningFeatureInterface.h new file mode 100644 index 0000000..81e96f6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/PixelBinningFeatureInterface.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file PixelBinningFeatureInterface.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric cooler (TEC) feature. + * + * 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 PIXELBINNINGFEATUREINTERFACE_H +#define PIXELBINNINGFEATUREINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class PixelBinningFeatureInterface { + public: + virtual ~PixelBinningFeatureInterface() = 0; + virtual void setPixelBinningFactor(const Protocol &protocol, + const Bus &bus, const unsigned char binningFactor) throw (FeatureException) = 0; + virtual unsigned char getPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual void setDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus, const unsigned char binningFactor) throw (FeatureException) = 0; + virtual void setDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual unsigned char getDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual unsigned char getMaxPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; +} + +#endif /* PIXELBINNINGFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/STSPixelBinningFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/STSPixelBinningFeature.h new file mode 100644 index 0000000..72fb1de --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/pixel_binning/STSPixelBinningFeature.h @@ -0,0 +1,89 @@ +/***************************************************//** + * @file STSPixelBinningFeature.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric unit for devices with a clean + * protocol implementation. This is an abstract base + * class but it does much of the work needed for most + * implementations that can delegate almost everything + * to the protocol layer. + * + * 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 STSPIXELBINNINGFEATURE_H +#define STSPIXELBINNINGFEATURE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/protocols/ProtocolHelper.h" +#include "common/features/FeatureImpl.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/pixel_binning/PixelBinningFeatureInterface.h" + +namespace seabreeze { + + class STSSpectrometerFeature; + + class STSPixelBinningFeature : public FeatureImpl, + public PixelBinningFeatureInterface { + public: + STSPixelBinningFeature(std::vector helpers, + STSSpectrometerFeature *spectroFeature); + virtual ~STSPixelBinningFeature(); + + virtual void setPixelBinningFactor(const Protocol &protocol, + const Bus &bus, const unsigned char binningFactor) + throw (FeatureException); + virtual unsigned char getPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual void setDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus, const unsigned char binningFactor) + throw (FeatureException); + virtual void setDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual unsigned char getDefaultPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual unsigned char getMaxPixelBinningFactor(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Inherited from Feature */ + /* This is still abstract in case the device needs to do anything + * special with regards to defaults when it is initialized. + */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + + virtual FeatureFamily getFeatureFamily(); + + protected: + STSSpectrometerFeature *spectrometerFeature; + }; +} + +#endif /* STSPIXELBINNINGFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeature.h new file mode 100644 index 0000000..2e5f91f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file RawUSBBusAccessFeature.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_RAW_USB_BUS_ACCESS_FEATURE_H +#define SEABREEZE_RAW_USB_BUS_ACCESS_FEATURE_H + +#include "common/features/FeatureImpl.h" +#include "common/exceptions/FeatureException.h" +#include "vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeatureInterface.h" +#include "common/buses/usb/USBInterface.h" + +namespace seabreeze { + + class RawUSBBusAccessFeature : public FeatureImpl, + public RawUSBBusAccessFeatureInterface { + public: + RawUSBBusAccessFeature(); + virtual ~RawUSBBusAccessFeature(); + virtual std::vector readUSB(const USBInterface *bus, int endpoint, + unsigned int length) throw (FeatureException); + virtual int writeUSB(const USBInterface *bus, int endpoint, + const std::vector &data) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeatureInterface.h new file mode 100644 index 0000000..0814f81 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/raw_bus_access/RawUSBBusAccessFeatureInterface.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file RawUSBBusAccessFeatureInterface.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_RAW_USB_BUS_ACCESS_FEATURE_INTERFACE_H +#define SEABREEZE_RAW_USB_BUS_ACCESS_FEATURE_INTERFACE_H + +#include "common/features/Feature.h" +#include "common/exceptions/FeatureException.h" +#include "common/buses/usb/USBInterface.h" + +namespace seabreeze { + + class RawUSBBusAccessFeatureInterface { + public: + virtual ~RawUSBBusAccessFeatureInterface() = 0; + virtual std::vector readUSB(const USBInterface *bus, int endpoint, + unsigned int length ) throw (FeatureException) = 0; + virtual int writeUSB(const USBInterface *bus, int endpoint, + const std::vector &data) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline RawUSBBusAccessFeatureInterface::~RawUSBBusAccessFeatureInterface() {} +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeature.h new file mode 100644 index 0000000..bbd3c39 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeature.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file RevisionFeature.h + * @date January 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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 REVISIONFEATURE_H +#define REVISIONFEATURE_H + +#include + +#include "vendors/OceanOptics/features/revision/RevisionFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class RevisionFeature + : public FeatureImpl, public RevisionFeatureInterface { + public: + RevisionFeature(std::vector helpers); + virtual ~RevisionFeature(); + virtual unsigned char readHardwareRevision(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual unsigned short int readFirmwareRevision(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* REVISIONFEATURE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeatureInterface.h new file mode 100644 index 0000000..28db95d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/revision/RevisionFeatureInterface.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file RevisionFeatureInterface.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 REVISIONFEATUREINTERFACE_H +#define REVISIONFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class RevisionFeatureInterface { + public: + virtual ~RevisionFeatureInterface() = 0; + virtual unsigned char readHardwareRevision(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual unsigned short int readFirmwareRevision(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline RevisionFeatureInterface::~RevisionFeatureInterface() {} +} + +#endif /* REVISIONFEATUREINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeature.h new file mode 100644 index 0000000..1b7adb6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeature.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file SerialNumberFeature.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SERIALNUMBERFEATURE_H +#define SERIALNUMBERFEATURE_H + +#include + +#include "vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class SerialNumberFeature : public FeatureImpl, public SerialNumberFeatureInterface { + public: + SerialNumberFeature(std::vector helpers); + virtual ~SerialNumberFeature(); + virtual std::string *readSerialNumber(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual unsigned char readSerialNumberMaximumLength(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* SERIALNUMBERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h new file mode 100644 index 0000000..2597d48 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/serial_number/SerialNumberFeatureInterface.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file SerialNumberFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SERIALNUMBERFEATUREINTERFACE_H +#define SERIALNUMBERFEATUREINTERFACE_H + +#include +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class SerialNumberFeatureInterface { + public: + virtual ~SerialNumberFeatureInterface() = 0; + virtual unsigned char readSerialNumberMaximumLength(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual std::string *readSerialNumber(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline SerialNumberFeatureInterface::~SerialNumberFeatureInterface() {} +} + +#endif /* SERIALNUMBERFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeature.h new file mode 100644 index 0000000..d0a1b88 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeature.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file ShutterFeature.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SHUTTERFEATURE_H +#define SHUTTERFEATURE_H + +#include + +#include "vendors/OceanOptics/features/shutter/ShutterFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class ShutterFeature : public FeatureImpl, public ShutterFeatureInterface { + public: + ShutterFeature(std::vector helpers); + virtual ~ShutterFeature(); + virtual void setShutterOpen(const Protocol &protocol, + const Bus &bus, bool opened) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* SHUTTERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeatureInterface.h new file mode 100644 index 0000000..5eb35bb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/shutter/ShutterFeatureInterface.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file ShutterFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SHUTTERFEATUREINTERFACE_H +#define SHUTTERFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class ShutterFeatureInterface { + public: + virtual ~ShutterFeatureInterface() = 0; + virtual void setShutterOpen(const Protocol &protocol, + const Bus &bus, bool opened) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline ShutterFeatureInterface::~ShutterFeatureInterface() {} +} + +#endif /* SHUTTERFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ApexSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ApexSpectrometerFeature.h new file mode 100644 index 0000000..661a266 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ApexSpectrometerFeature.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file ApexSpectrometerFeature.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 APEXSPECTROMETERFEATURE_H +#define APEXSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class ApexSpectrometerFeature : public GainAdjustedSpectrometerFeature { + public: + ApexSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~ApexSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* APEXSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/BlazeSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/BlazeSpectrometerFeature.h new file mode 100644 index 0000000..b51fd73 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/BlazeSpectrometerFeature.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file BlazeSpectrometerFeature.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 BLAZESPECTROMETERFEATURE_H +#define BLAZESPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class BlazeSpectrometerFeature : public GainAdjustedSpectrometerFeature { + public: + BlazeSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~BlazeSpectrometerFeature(); + + /* The Blaze gets wavelengths a bit differently */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* BLAZESPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/FlameNIRSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/FlameNIRSpectrometerFeature.h new file mode 100644 index 0000000..64dda46 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/FlameNIRSpectrometerFeature.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file FlameNIRSpectrometerFeature.h + * @date Apr 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 FLAMENIRSPECTROMETERFEATURE_H +#define FLAMENIRSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class FlameNIRSpectrometerFeature + : public GainAdjustedSpectrometerFeature { + public: + FlameNIRSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~FlameNIRSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h new file mode 100644 index 0000000..a38b63d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file GainAdjustedSpectrometerFeature.h + * @date July 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 GAINADJUSTEDSPECTROMETERFEATURE_H +#define GAINADJUSTEDSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" +#include "vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeature.h" + +namespace seabreeze { + + class GainAdjustedSpectrometerFeature : public OOISpectrometerFeature { + public: + GainAdjustedSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~GainAdjustedSpectrometerFeature(); + + virtual unsigned int getSaturationLevel(); + + /* Inherited from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + protected: + ProgrammableSaturationFeature *saturation; + }; + +} + +#endif /* GAINADJUSTEDSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000PlusSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000PlusSpectrometerFeature.h new file mode 100644 index 0000000..8d591f1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000PlusSpectrometerFeature.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file HR2000PlusSpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000PLUSSPECTROMETERFEATURE_H +#define HR2000PLUSSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class HR2000PlusSpectrometerFeature : public OOISpectrometerFeature { + public: + HR2000PlusSpectrometerFeature(); + virtual ~HR2000PlusSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* HR2000PLUSSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000SpectrometerFeature.h new file mode 100644 index 0000000..c50692a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR2000SpectrometerFeature.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file HR2000SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR2000SPECTROMETERFEATURE_H +#define HR2000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class HR2000SpectrometerFeature : public OOISpectrometerFeature { + public: + HR2000SpectrometerFeature(); + virtual ~HR2000SpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* HR2000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR4000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR4000SpectrometerFeature.h new file mode 100644 index 0000000..dad72b0 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/HR4000SpectrometerFeature.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file HR4000SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 HR4000SPECTROMETERFEATURE_H +#define HR4000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class HR4000SpectrometerFeature : public OOISpectrometerFeature { + public: + HR4000SpectrometerFeature(); + virtual ~HR4000SpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* HR4000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/JazSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/JazSpectrometerFeature.h new file mode 100644 index 0000000..be865fe --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/JazSpectrometerFeature.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file JazSpectrometerFeature.h + * @date November 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 JAZSPECTROMETERFEATURE_H +#define JAZSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class JazSpectrometerFeature + : public GainAdjustedSpectrometerFeature { + public: + JazSpectrometerFeature(ProgrammableSaturationFeature *saturationFeature); + virtual ~JazSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* JAZSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000ProSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000ProSpectrometerFeature.h new file mode 100644 index 0000000..792625a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000ProSpectrometerFeature.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file Maya2000ProSpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000PROSPECTROMETERFEATURE_H +#define MAYA2000PROSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class Maya2000ProSpectrometerFeature + : public GainAdjustedSpectrometerFeature { + public: + Maya2000ProSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~Maya2000ProSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* MAYA2000PROSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000SpectrometerFeature.h new file mode 100644 index 0000000..ff2da12 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/Maya2000SpectrometerFeature.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file Maya2000SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYA2000SPECTROMETERFEATURE_H +#define MAYA2000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class Maya2000SpectrometerFeature : public OOISpectrometerFeature { + public: + Maya2000SpectrometerFeature(); + virtual ~Maya2000SpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* MAYA2000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/MayaLSLSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/MayaLSLSpectrometerFeature.h new file mode 100644 index 0000000..5c73755 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/MayaLSLSpectrometerFeature.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file MayaLSLSpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 MAYALSLSPECTROMETERFEATURE_H +#define MAYALSLSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class MayaLSLSpectrometerFeature : public GainAdjustedSpectrometerFeature { + public: + MayaLSLSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~MayaLSLSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* MAYALSLSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest256SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest256SpectrometerFeature.h new file mode 100644 index 0000000..c550920 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest256SpectrometerFeature.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file NIRQuest256SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST256SPECTROMETERFEATURE_H +#define NIRQUEST256SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/NIRQuestSpectrometerFeature.h" + +namespace seabreeze { + + class NIRQuest256SpectrometerFeature : public NIRQuestSpectrometerFeature { + public: + NIRQuest256SpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~NIRQuest256SpectrometerFeature(); + }; + +} + +#endif /* NIRQUEST256SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest512SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest512SpectrometerFeature.h new file mode 100644 index 0000000..9331054 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuest512SpectrometerFeature.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file NIRQuest512SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUEST512SPECTROMETERFEATURE_H +#define NIRQUEST512SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/NIRQuestSpectrometerFeature.h" + +namespace seabreeze { + + class NIRQuest512SpectrometerFeature : public NIRQuestSpectrometerFeature { + public: + NIRQuest512SpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~NIRQuest512SpectrometerFeature(); + }; + +} + +#endif /* NIRQUEST512SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuestSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuestSpectrometerFeature.h new file mode 100644 index 0000000..365a59d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/NIRQuestSpectrometerFeature.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file NIRQuestSpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NIRQUESTSPECTROMETERFEATURE_H +#define NIRQUESTSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class NIRQuestSpectrometerFeature : public GainAdjustedSpectrometerFeature { + public: + NIRQuestSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~NIRQuestSpectrometerFeature(); + + protected: + void setupExchanges(int readoutLength); + + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* NIRQUESTSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h new file mode 100644 index 0000000..ad2ceae --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h @@ -0,0 +1,111 @@ +/***************************************************//** + * @file OOISpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOISPECTROMETERFEATURE_H +#define OOISPECTROMETERFEATURE_H + +#include +#include "common/features/FeatureImpl.h" +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h" +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeatureInterface.h" + +namespace seabreeze { + + class OOISpectrometerFeature : public FeatureImpl, + public OOISpectrometerFeatureInterface { + public: + OOISpectrometerFeature(); + virtual ~OOISpectrometerFeature(); + /* Request and read out a spectrum formatted into intensity (A/D counts) */ + virtual std::vector *getSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Request and read out the raw spectrum data stream */ + virtual std::vector *getUnformattedSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Request and read out the wavelengths in nanometers as a vector of doubles */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Read the raw spectrum data stream. No request is made first. */ + virtual std::vector *readUnformattedSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Set the integration time of the spectrometer */ + virtual void setIntegrationTimeMicros(const Protocol &protocol, + const Bus &bus, unsigned long time_usec) + throw (FeatureException, IllegalArgumentException); + + /* Request that the spectrometer make a spectrum available for + * reading (e.g. with readUnformattedSpectrum()) + */ + virtual void writeRequestSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Setting the external trigger mode for the spectrometer */ + virtual void setTriggerMode(const Protocol &protocol, + const Bus &bus, SpectrometerTriggerMode &mode) throw (FeatureException); + + virtual std::vector getTriggerModes() const; + + virtual std::vector getElectricDarkPixelIndices() const; + + virtual long getIntegrationTimeMinimum() const; + virtual long getIntegrationTimeMaximum() const; + virtual long getIntegrationTimeIncrement() const; + + virtual int getNumberOfPixels() const; + virtual int getMaximumIntensity() const; + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + protected: + /* Detector details */ + int numberOfPixels; + int maxIntensity; + + /* Integration time parameters (measured in microseconds) */ + long integrationTimeMinimum; + long integrationTimeMaximum; + long integrationTimeBase; + long integrationTimeIncrement; + + std::vector triggerModes; + std::vector electricDarkPixelIndices; + }; + +} + +#endif /* OOISPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeatureInterface.h new file mode 100644 index 0000000..8d896e7 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/OOISpectrometerFeatureInterface.h @@ -0,0 +1,95 @@ +/***************************************************//** + * @file OOISpectrometerFeatureInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOISPECTROMETERFEATUREINTERFACE_H +#define OOISPECTROMETERFEATUREINTERFACE_H + +#include +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h" + +namespace seabreeze { + + class OOISpectrometerFeatureInterface { + public: + virtual ~OOISpectrometerFeatureInterface() = 0; + + /* Request and read out a spectrum formatted into intensity (A/D counts) */ + virtual std::vector *getSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Request and read out the raw spectrum data stream */ + virtual std::vector *getUnformattedSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Request and read out the wavelengths in nanometers as a vector of doubles */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Read the raw spectrum data stream. No request is made first. */ + virtual std::vector *readUnformattedSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Set the integration time of the spectrometer */ + virtual void setIntegrationTimeMicros(const Protocol &protocol, + const Bus &bus, unsigned long time_usec) + throw (FeatureException, IllegalArgumentException) = 0; + + /* Request that the spectrometer make a spectrum available for + * reading (e.g. with readUnformattedSpectrum()) + */ + virtual void writeRequestSpectrum(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Setting the external trigger mode for the spectrometer */ + virtual void setTriggerMode(const Protocol &protocol, + const Bus &bus, SpectrometerTriggerMode &mode) throw (FeatureException) = 0; + + virtual std::vector getTriggerModes() const = 0; + + virtual std::vector getElectricDarkPixelIndices() const = 0; + + virtual long getIntegrationTimeMinimum() const = 0; + virtual long getIntegrationTimeMaximum() const = 0; + virtual long getIntegrationTimeIncrement() const = 0; + + virtual int getNumberOfPixels() const = 0; + virtual int getMaximumIntensity() const = 0; + + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline OOISpectrometerFeatureInterface::~OOISpectrometerFeatureInterface() {} + +} + +#endif /* OOISPECTROMETERFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeature.h new file mode 100644 index 0000000..bb21810 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeature.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file ProgrammableSaturationFeature.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 PROGRAMMABLESATURATIONFEATURE_H +#define PROGRAMMABLESATURATIONFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureInterface.h" +#include "common/features/Feature.h" +#include + +namespace seabreeze { + /* ProgrammableSaturationFeature might be implemented by extending another + * Feature, so this needs to use virtual inheritance to solve the + * diamond problem. + */ + class ProgrammableSaturationFeature : public virtual Feature, + public ProgrammableSaturationFeatureInterface { + + public: + ProgrammableSaturationFeature(); + virtual ~ProgrammableSaturationFeature(); + + virtual unsigned int getSaturation() throw (FeatureException) = 0; + + /* Overriding from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException) = 0; + + virtual FeatureFamily getFeatureFamily() = 0; + }; + +} /* end namespace seabreeze */ + +#endif /* PROGRAMMABLESATURATIONFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureBase.h new file mode 100644 index 0000000..762b7fa --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureBase.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file ProgrammableSaturationFeatureBase.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 PROGRAMMABLESATURATIONFEATUREBASE_H +#define PROGRAMMABLESATURATIONFEATUREBASE_H + +#include "vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeature.h" + +namespace seabreeze { + + class ProgrammableSaturationFeatureBase + : public ProgrammableSaturationFeature { + public: + ProgrammableSaturationFeatureBase(); + virtual ~ProgrammableSaturationFeatureBase(); + + /* Inherited from ProgrammableSaturationFeature */ + virtual unsigned int getSaturation() throw (FeatureException); + + /* Overriding from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + virtual FeatureFamily getFeatureFamily(); + + protected: + /* Derived classes must implement this in whatever way is appropriate + * to get the saturation level for the device. + */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + private: + unsigned int saturation; + bool valid; + }; + +} /* end namespace seabreeze */ + +#endif /* PROGRAMMABLESATURATIONFEATUREBASE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureImpl.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureImpl.h new file mode 100644 index 0000000..b54a333 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureImpl.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file ProgrammableSaturationFeatureImpl.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 PROGRAMMABLESATURATIONFEATUREIMPL_H +#define PROGRAMMABLESATURATIONFEATUREIMPL_H + +#include "vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureBase.h" +#include "common/features/FeatureImpl.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + /* This class is intended for devices that have a clean protocol + * interface for reading out the saturation level directly. + */ + class ProgrammableSaturationFeatureImpl + : public ProgrammableSaturationFeatureBase, FeatureImpl { + public: + ProgrammableSaturationFeatureImpl(std::vector helpers); + virtual ~ProgrammableSaturationFeatureImpl(); + + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + virtual FeatureFamily getFeatureFamily(); + + protected: + /* Inherited from ProgrammableSaturationFeatureBase */ + virtual unsigned int getSaturation(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + }; + +} /* end namespace seabreeze */ + +#endif /* PROGRAMMABLESATURATIONFEATUREIMPL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureInterface.h new file mode 100644 index 0000000..f4e9893 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/ProgrammableSaturationFeatureInterface.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file ProgrammableSaturationFeatureInterface.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 PROGRAMMABLESATURATIONFEATUREINTERFACE_H +#define PROGRAMMABLESATURATIONFEATUREINTERFACE_H + +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class ProgrammableSaturationFeatureInterface { + public: + virtual ~ProgrammableSaturationFeatureInterface() = 0; + + /* + * Get the detector saturation level from the device. + */ + virtual unsigned int getSaturation() throw (FeatureException) = 0; + }; + + + /* Default implementation for (otherwise) pure virtual destructor */ + inline ProgrammableSaturationFeatureInterface::~ProgrammableSaturationFeatureInterface() {} + +} /* end namespace seabreeze */ + +#endif /* PROGRAMMABLESATURATIONFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QE65000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QE65000SpectrometerFeature.h new file mode 100644 index 0000000..61f6113 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QE65000SpectrometerFeature.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file QE65000SpectrometerFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QE65000SPECTROMETERFEATURE_H +#define QE65000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class QE65000SpectrometerFeature : public OOISpectrometerFeature { + public: + QE65000SpectrometerFeature(); + virtual ~QE65000SpectrometerFeature(); + + /* Overridden from OOISpectrometerFeature because the QE65000 + * wavelength calibration is done differently than in most others + */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* QE65000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QEProSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QEProSpectrometerFeature.h new file mode 100644 index 0000000..2e4dde6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/QEProSpectrometerFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file QEProSpectrometerFeature.h + * @date June 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QEPROSPECTROMETERFEATURE_H +#define QEPROSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class QEProSpectrometerFeature : public OOISpectrometerFeature { + public: + QEProSpectrometerFeature(); + virtual ~QEProSpectrometerFeature(); + + /* The QE-PRO gets wavelengths a bit differently */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* QEPROSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/STSSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/STSSpectrometerFeature.h new file mode 100644 index 0000000..6c46dcb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/STSSpectrometerFeature.h @@ -0,0 +1,74 @@ +/***************************************************//** + * @file STSSpectrometerFeature.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STSSPECTROMETERFEATURE_H +#define STSSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/temperature/TemperatureFeature.h" +#include "vendors/OceanOptics/protocols/obp/impls/OBPTemperatureProtocol.h" +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + + +#define STS_TEMPERATURE_DETECTOR_INDEX 0 +#define STS_TEMPERATURE_RESERVED_INDEX 1 +#define STS_TEMPERATURE_CPU_INDEX 2 + +namespace seabreeze { + + namespace oceanBinaryProtocol { + class OBPReadRawSpectrumExchange; + class OBPReadSpectrumExchange; + } + + class STSSpectrometerFeature : public OOISpectrometerFeature { + public: + STSSpectrometerFeature(); + virtual ~STSSpectrometerFeature(); + + void setPixelBinningFactor(unsigned char binningFactor); + + /* The STS gets wavelengths a bit differently */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + oceanBinaryProtocol::OBPReadRawSpectrumExchange *unformattedSpectrum; + oceanBinaryProtocol::OBPReadSpectrumExchange *formattedSpectrum; + unsigned char binningFactor; + + static const unsigned int unbinnedNumberOfPixels = 1024; + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* STSSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SparkSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SparkSpectrometerFeature.h new file mode 100644 index 0000000..9d26c0d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SparkSpectrometerFeature.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file SparkSpectrometerFeature.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SPARKSPECTROMETERFEATURE_H +#define SPARKSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/temperature/TemperatureFeature.h" +#include "vendors/OceanOptics/protocols/obp/impls/OBPTemperatureProtocol.h" +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + + +#define SPARK_TEMPERATURE_DETECTOR_INDEX 0 +#define SPARK_TEMPERATURE_RESERVED_INDEX 1 +#define SPARK_TEMPERATURE_CPU_INDEX 2 + +namespace seabreeze { + + class SparkSpectrometerFeature : public OOISpectrometerFeature { + public: + SparkSpectrometerFeature(); + virtual ~SparkSpectrometerFeature(); + + /* The Spark gets wavelengths a bit differently */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* SPARKSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h new file mode 100644 index 0000000..3a4443c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h @@ -0,0 +1,70 @@ +/***************************************************//** + * @file SpectrometerTriggerMode.h + * @date August 2009 + * @author Ocean Optics, Inc. + * + * This file describes the different kinds of trigger modes + * that spectrometers may support. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SPECTROMETER_TRIGGER_MODE_H +#define SPECTROMETER_TRIGGER_MODE_H + +#define SPECTROMETER_TRIGGER_MODE_NORMAL 0x00 +#define SPECTROMETER_TRIGGER_MODE_SOFTWARE 0x01 +#define SPECTROMETER_TRIGGER_MODE_LEVEL 0x01 +#define SPECTROMETER_TRIGGER_MODE_SYNCHRONIZATION 0x02 +#define SPECTROMETER_TRIGGER_MODE_HARDWARE 0x03 +#define SPECTROMETER_TRIGGER_MODE_EDGE 0x03 +#define SPECTROMETER_TRIGGER_MODE_SINGLE_SHOT 0x04 +#define SPECTROMETER_TRIGGER_MODE_SELF_NORMAL 0x80 +#define SPECTROMETER_TRIGGER_MODE_SELF_SOFTWARE 0x81 +#define SPECTROMETER_TRIGGER_MODE_SELF_SYNCHRONIZATION 0x82 +#define SPECTROMETER_TRIGGER_MODE_SELF_HARDWARE 0x83 + +#define SPECTROMETER_TRIGGER_MODE_OBP_NORMAL 0x00 +#define SPECTROMETER_TRIGGER_MODE_OBP_EXTERNAL 0x01 +#define SPECTROMETER_TRIGGER_MODE_OBP_INTERNAL 0x02 + +namespace seabreeze { + + class SpectrometerTriggerMode { + public: + SpectrometerTriggerMode(int mode); + virtual ~SpectrometerTriggerMode(); + + int getTriggerMode(); + + /* Overriding equality operator so that modes can be compared. */ + bool operator==(const SpectrometerTriggerMode &that); + + private: + int triggerMode; + }; + +} + +#endif /* SPECTROMETER_TRIGGER_MODE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000PlusSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000PlusSpectrometerFeature.h new file mode 100644 index 0000000..afe62e8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000PlusSpectrometerFeature.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file USB2000PlusSpectrometerFeature.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000PLUSSPECTROMETERFEATURE_H +#define USB2000PLUSSPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class USB2000PlusSpectrometerFeature + : public GainAdjustedSpectrometerFeature { + public: + USB2000PlusSpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~USB2000PlusSpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* USB2000PLUSSPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000SpectrometerFeature.h new file mode 100644 index 0000000..d470c37 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB2000SpectrometerFeature.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file USB2000SpectrometerFeature.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB2000SPECTROMETERFEATURE_H +#define USB2000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class USB2000SpectrometerFeature : public OOISpectrometerFeature { + public: + USB2000SpectrometerFeature(); + virtual ~USB2000SpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* USB2000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB4000SpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB4000SpectrometerFeature.h new file mode 100644 index 0000000..b43b6ef --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/USB4000SpectrometerFeature.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file USB4000SpectrometerFeature.h + * @date May 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 USB4000SPECTROMETERFEATURE_H +#define USB4000SPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + + class USB4000SpectrometerFeature : public GainAdjustedSpectrometerFeature { + public: + USB4000SpectrometerFeature( + ProgrammableSaturationFeature *saturationFeature); + virtual ~USB4000SpectrometerFeature(); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* USB4000SPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/VentanaSpectrometerFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/VentanaSpectrometerFeature.h new file mode 100644 index 0000000..ee24b9e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrometer/VentanaSpectrometerFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file VentanaSpectrometerFeature.h + * @date January 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENTANASPECTROMETERFEATURE_H +#define VENTANASPECTROMETERFEATURE_H + +#include "vendors/OceanOptics/features/spectrometer/OOISpectrometerFeature.h" + +namespace seabreeze { + + class VentanaSpectrometerFeature : public OOISpectrometerFeature { + public: + VentanaSpectrometerFeature(); + virtual ~VentanaSpectrometerFeature(); + + /* The Ventana gets wavelengths a bit differently */ + virtual std::vector *getWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + private: + static const long INTEGRATION_TIME_MINIMUM; + static const long INTEGRATION_TIME_MAXIMUM; + static const long INTEGRATION_TIME_INCREMENT; + static const long INTEGRATION_TIME_BASE; + }; + +} + +#endif /* VENTANASPECTROMETERFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeature.h new file mode 100644 index 0000000..a41a265 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeature.h @@ -0,0 +1,68 @@ +/***************************************************//** + * @file SpectrumProcessingFeature.h + * @date February 2015 + * @author Kirk Clendinning, Heliospectra + * + * 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 SPECTRUMPROCESSINGFEATURE_H +#define SPECTRUMPROCESSINGFEATURE_H + +#include + +#include "vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class SpectrumProcessingFeature + : public FeatureImpl, public SpectrumProcessingFeatureInterface { + public: + SpectrumProcessingFeature(std::vector helpers); + virtual ~SpectrumProcessingFeature(); + virtual unsigned char readSpectrumProcessingBoxcarWidth( + const Protocol &protocol, const Bus &bus) + throw (FeatureException); + virtual unsigned short int readSpectrumProcessingScansToAverage( + const Protocol &protocol, const Bus &bus) + throw (FeatureException); + virtual void writeSpectrumProcessingBoxcarWidth(const Protocol &protocol, + const Bus &bus, unsigned char boxcarWidth) + throw (FeatureException, IllegalArgumentException); + virtual void writeSpectrumProcessingScansToAverage(const Protocol &protocol, + const Bus &bus, unsigned short int scansToAverage) + throw (FeatureException, IllegalArgumentException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* SPECTRUMPROCESSINGFEATURE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeatureInterface.h new file mode 100644 index 0000000..95d1e63 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/spectrum_processing/SpectrumProcessingFeatureInterface.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file SpectrumProcessingFeatureInterface.h + * @date February 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 SPECTRUMPROCESSINGFEATUREINTERFACE_H +#define SPECTRUMPROCESSINGFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class SpectrumProcessingFeatureInterface { + public: + virtual ~SpectrumProcessingFeatureInterface() = 0; + virtual unsigned char readSpectrumProcessingBoxcarWidth(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual unsigned short int readSpectrumProcessingScansToAverage(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual void writeSpectrumProcessingBoxcarWidth(const Protocol &protocol, + const Bus &bus, unsigned char boxcarWidth) + throw (FeatureException, IllegalArgumentException) = 0; + virtual void writeSpectrumProcessingScansToAverage(const Protocol &protocol, + const Bus &bus, unsigned short int scansToAverage) + throw (FeatureException, IllegalArgumentException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline SpectrumProcessingFeatureInterface::~SpectrumProcessingFeatureInterface() {} +} + +#endif /* SPECTRUMPROCESSINGFEATUREINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeature.h new file mode 100644 index 0000000..712c26f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeature.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file StrayLightCoeffsFeature.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STRAYLIGHTCOEFFSFEATURE_H +#define STRAYLIGHTCOEFFSFEATURE_H + +#include + +#include "vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class StrayLightCoeffsFeature + : public FeatureImpl, public StrayLightCoeffsFeatureInterface { + public: + StrayLightCoeffsFeature(std::vector helpers); + virtual ~StrayLightCoeffsFeature(); + virtual std::vector *readStrayLightCoefficients(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* STRAYLIGHTCOEFFSFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h new file mode 100644 index 0000000..1fbe6d1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/stray_light/StrayLightCoeffsFeatureInterface.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file StrayLightCoeffsFeatureInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STRAYLIGHTCOEFFSFEATUREINTERFACE_H +#define STRAYLIGHTCOEFFSFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class StrayLightCoeffsFeatureInterface { + public: + virtual ~StrayLightCoeffsFeatureInterface() = 0; + virtual std::vector *readStrayLightCoefficients(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline StrayLightCoeffsFeatureInterface::~StrayLightCoeffsFeatureInterface() {} +} + +#endif /* STRAYLIGHTCOEFFSFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeature.h new file mode 100644 index 0000000..c28ac96 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeature.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file TemperatureFeature.h + * @date January 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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 TEMPERATUREFEATURE_H +#define TEMPERATUREFEATURE_H + +#include + +#include "vendors/OceanOptics/features/temperature/TemperatureFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class TemperatureFeature + : public FeatureImpl, public TemperatureFeatureInterface { + public: + TemperatureFeature(std::vector helpers); + virtual ~TemperatureFeature(); + + virtual unsigned char readTemperatureCount(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + virtual double readTemperature(const Protocol &protocol, + const Bus &bus, int index) throw (FeatureException); + + virtual std::vector *readAllTemperatures( + const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* TEMPERATUREFEATURE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeatureInterface.h new file mode 100644 index 0000000..7c8ed22 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/temperature/TemperatureFeatureInterface.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file TemperatureFeatureInterface.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 TEMPERATUREFEATUREINTERFACE_H +#define TEMPERATUREFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class TemperatureFeatureInterface { + public: + virtual ~TemperatureFeatureInterface() = 0; + virtual unsigned char readTemperatureCount(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual double readTemperature(const Protocol &protocol, + const Bus &bus, int index) throw (FeatureException) = 0; + virtual std::vector *readAllTemperatures(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline TemperatureFeatureInterface::~TemperatureFeatureInterface() {} +} + +#endif /* TEMPERATUREFEATUREINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/QEProThermoElectricFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/QEProThermoElectricFeature.h new file mode 100644 index 0000000..e73c22d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/QEProThermoElectricFeature.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file QEProThermoElectricFeature.h + * @date September 2013 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric unit (TEC) on the QE-PRO. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 QEPROTHERMOELECTRICFEATURE_H +#define QEPROTHERMOELECTRICFEATURE_H + +#include "vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h" + +namespace seabreeze { + class QEProThermoElectricFeature : public ThermoElectricFeatureBase { + public: + QEProThermoElectricFeature(); + virtual ~QEProThermoElectricFeature(); + + /* Inherited from ThermoElectricFeatureBase where they are pure virtual */ + virtual double getDefaultSetPointCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual bool getDefaultThermoElectricEnable(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Override from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + }; +} + +#endif /* QEPROTHERMOELECTRICFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h new file mode 100644 index 0000000..70fe887 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h @@ -0,0 +1,84 @@ +/***************************************************//** + * @file ThermoElectricFeatureBase.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric unit for devices with a clean + * protocol implementation. This is an abstract base + * class but it does much of the work needed for most + * implementations that can delegate almost everything + * to the protocol layer. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 THERMOELECTRICFEATUREBASE_H +#define THERMOELECTRICFEATUREBASE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/protocols/ProtocolHelper.h" +#include "common/features/FeatureImpl.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureInterface.h" + +namespace seabreeze { + + class ThermoElectricFeatureBase : public FeatureImpl, + public ThermoElectricFeatureInterface { + public: + ThermoElectricFeatureBase(); + virtual ~ThermoElectricFeatureBase(); + virtual void setThermoElectricEnable(const Protocol &protocol, + const Bus &bus, bool enable) throw (FeatureException); + virtual double getTemperatureCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual void setTemperatureSetPointCelsius(const Protocol &protocol, + const Bus &bus, double degreesC) + throw (FeatureException, IllegalArgumentException); + + /* These remain abstract because the limits of any given device will + * depend on its implementation. They will either need to be hardcoded + * into the implementation or be queried from the device. + */ + virtual double getDefaultSetPointCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual bool getDefaultThermoElectricEnable(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + + /* Inherited from Feature */ + /* This is still abstract in case the device needs to do anything + * special with regards to defaults when it is initialized. + */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException) = 0; + + virtual FeatureFamily getFeatureFamily(); + }; + +} + +#endif /* THERMOELECTRICFEATUREBASE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureInterface.h new file mode 100644 index 0000000..bf4771d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureInterface.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file ThermoElectricFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric cooler (TEC) feature. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 THERMOELECTRICFEATUREINTERFACE_H +#define THERMOELECTRICFEATUREINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + + class ThermoElectricFeatureInterface { + public: + virtual ~ThermoElectricFeatureInterface() = 0; + virtual void setThermoElectricEnable(const Protocol &protocol, + const Bus &bus, bool enable) throw (FeatureException) = 0; + virtual double getTemperatureCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual void setTemperatureSetPointCelsius(const Protocol &protocol, + const Bus &bus, double degreesC) + throw (FeatureException, IllegalArgumentException) = 0; + + virtual double getDefaultSetPointCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + virtual bool getDefaultThermoElectricEnable(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline ThermoElectricFeatureInterface::~ThermoElectricFeatureInterface() {} +} + +#endif /* THERMOELECTRICFEATUREINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricQEFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricQEFeature.h new file mode 100644 index 0000000..3dd787c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/ThermoElectricQEFeature.h @@ -0,0 +1,68 @@ +/***************************************************//** + * @file ThermoElectricQEFeature.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric cooler (TEC) on the QE65000 and similar + * spectrometers (including the NIRQuest). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 THERMOELECTRICQEFEATURE_H +#define THERMOELECTRICQEFEATURE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/features/Feature.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h" + +namespace seabreeze { + + class ThermoElectricQEFeature : public ThermoElectricFeatureBase { + public: + ThermoElectricQEFeature(); + virtual ~ThermoElectricQEFeature(); + + /* Inherited from ThermoElectricFeatureBase where they are pure virtual */ + double getDefaultSetPointCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + bool getDefaultThermoElectricEnable(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Override from Feature */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + + private: + std::vector *readTECDefaults(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + }; + +} + +#endif /* THERMOELECTRICQEFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/VentanaThermoElectricFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/VentanaThermoElectricFeature.h new file mode 100644 index 0000000..a1bf4eb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/thermoelectric/VentanaThermoElectricFeature.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file VentanaThermoElectricFeature.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * This feature provides an interface to the thermo- + * electric unit (TEC) on the Ventana. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 VENTANATHERMOELECTRICFEATURE_H +#define VENTANATHERMOELECTRICFEATURE_H + +#include "common/buses/Bus.h" +#include "common/protocols/Protocol.h" +#include "common/features/Feature.h" +#include "common/exceptions/FeatureException.h" +#include "common/exceptions/IllegalArgumentException.h" +#include "vendors/OceanOptics/features/thermoelectric/ThermoElectricFeatureBase.h" + +namespace seabreeze { + + class VentanaThermoElectricFeature : public ThermoElectricFeatureBase { + public: + VentanaThermoElectricFeature(); + virtual ~VentanaThermoElectricFeature(); + + /* Inherited from ThermoElectricFeatureBase where they are pure virtual */ + virtual double getDefaultSetPointCelsius(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + virtual bool getDefaultThermoElectricEnable(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Override from Feature, used to detect whether capability is present */ + virtual bool initialize(const Protocol &protocol, const Bus &bus) + throw (FeatureException); + }; + +} + +#endif /* VENTANATHERMOELECTRICFEATURE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeature.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeature.h new file mode 100644 index 0000000..f2f1c32 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeature.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file WaveCalFeature.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 WAVECALFEATURE_H +#define WAVECALFEATURE_H + +#include "vendors/OceanOptics/features/wavecal/WaveCalFeatureInterface.h" +#include "common/protocols/Protocol.h" +#include "common/features/FeatureImpl.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + class WaveCalFeature : public FeatureImpl, public WaveCalFeatureInterface { + public: + WaveCalFeature(std::vector helpers, + unsigned int numberOfPixels); + virtual ~WaveCalFeature(); + virtual std::vector *readWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException); + + /* Overriding from Feature */ + virtual FeatureFamily getFeatureFamily(); + + protected: + unsigned int numberOfPixels; + }; + +} + +#endif /* WAVECALFEATURE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeatureInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeatureInterface.h new file mode 100644 index 0000000..eb2daae --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/features/wavecal/WaveCalFeatureInterface.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file WaveCalFeatureInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 WAVECALFEATUREINTERFACE_H +#define WAVECALFEATUREINTERFACE_H + +#include "common/protocols/Protocol.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + class WaveCalFeatureInterface { + public: + virtual ~WaveCalFeatureInterface() = 0; + virtual std::vector *readWavelengths(const Protocol &protocol, + const Bus &bus) throw (FeatureException) = 0; + }; + + /* Default implementation for (otherwise) pure virtual destructor */ + inline WaveCalFeatureInterface::~WaveCalFeatureInterface() {} +} + +#endif /* WAVECALFEATUREINTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/AcquisitionDelayProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/AcquisitionDelayProtocolInterface.h new file mode 100644 index 0000000..2ca2ca6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/AcquisitionDelayProtocolInterface.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file AcquisitionDelayProtocolInterface.h + * @date November 2015 + * @author Ocean Optics, Inc. + * + * This is a generic interface into thermoelectric functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * 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_PROTOCOL_INTERFACE_H +#define ACQUISITION_DELAY_PROTOCOL_INTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class AcquisitionDelayProtocolInterface : public ProtocolHelper { + public: + AcquisitionDelayProtocolInterface(Protocol *protocol); + virtual ~AcquisitionDelayProtocolInterface(); + + virtual void setAcquisitionDelayMicroseconds(const Bus &bus, + const unsigned long delayMicros) throw (ProtocolException) = 0; + + /* At this point, the supported devices don't have protocol + * messages to get the current delay or the range of valid + * settings. Later, such functions could be added here if + * they are needed, but for now the protocol interface is + * being kept to a minimum. + */ + + }; + +} /* end namespace seabreeze */ + +#endif /* ACQUISITION_DELAY_PROTOCOL_INTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ContinuousStrobeProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ContinuousStrobeProtocolInterface.h new file mode 100644 index 0000000..966cfc6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ContinuousStrobeProtocolInterface.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file ContinuousStrobeProtocolInterface.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * This is a generic interface into lamp functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTINUOUS_STROBE_PROTOCOL_INTERFACE_H +#define SEABREEZE_CONTINUOUS_STROBE_PROTOCOL_INTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class ContinuousStrobeProtocolInterface : public ProtocolHelper { + public: + ContinuousStrobeProtocolInterface(Protocol *proto); + virtual ~ContinuousStrobeProtocolInterface(); + virtual void setContinuousStrobePeriodMicroseconds(const Bus &bus, + unsigned short strobe_id, unsigned long period_usec) + throw (ProtocolException) = 0; + virtual void setContinuousStrobeEnable(const Bus &bus, + unsigned short strobe_id, bool enable) + throw (ProtocolException) = 0; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/DataBufferProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/DataBufferProtocolInterface.h new file mode 100644 index 0000000..8f73656 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/DataBufferProtocolInterface.h @@ -0,0 +1,77 @@ +/***************************************************//** + * @file DataBufferProtocolInterface.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This is a generic interface into thermoelectric functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * 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 DATABUFFERPROTOCOLINTERFACE_H +#define DATABUFFERPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class DataBufferProtocolInterface : public ProtocolHelper { + public: + DataBufferProtocolInterface(Protocol *protocol); + virtual ~DataBufferProtocolInterface(); + + virtual void clearBuffer(const Bus &bus, unsigned char bufferIndex) + throw (ProtocolException) = 0; + + virtual unsigned long getNumberOfElements(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException) = 0; + + virtual unsigned long getBufferCapacity(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException) = 0; + + virtual unsigned long getBufferCapacityMinimum(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException) = 0; + + virtual unsigned long getBufferCapacityMaximum(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException) = 0; + + virtual void setBufferCapacity(const Bus &bus, + unsigned char bufferIndex, + const unsigned long capacity) + throw (ProtocolException) = 0; + }; + +} /* end namespace */ + +#endif /* DATABUFFERPROTOCOLINTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/EEPROMProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/EEPROMProtocolInterface.h new file mode 100644 index 0000000..92add4a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/EEPROMProtocolInterface.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file EEPROMProtocolInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * an EEPROM slot on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 EEPROMPROTOCOLINTERFACE_H +#define EEPROMPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + + class EEPROMProtocolInterface : public ProtocolHelper { + public: + EEPROMProtocolInterface(Protocol *protocol); + virtual ~EEPROMProtocolInterface(); + virtual std::vector *readEEPROMSlot(const Bus &bus, int slot) + throw (ProtocolException) = 0; + virtual int writeEEPROMSlot(const Bus &bus, int slot, + const std::vector &data) throw (ProtocolException) = 0; + }; + +} + +#endif /* EEPROMPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/FPGARegisterProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/FPGARegisterProtocolInterface.h new file mode 100644 index 0000000..38b92fb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/FPGARegisterProtocolInterface.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file FPGARegisterProtocolInterface.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * an FPGARegister slot on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_PROTOCOL_INTERFACE_H +#define SEABREEZE_FPGA_REGISTER_PROTOCOL_INTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class FPGARegisterProtocolInterface : public ProtocolHelper { + public: + FPGARegisterProtocolInterface(Protocol *protocol); + virtual ~FPGARegisterProtocolInterface(); + virtual unsigned int readRegister(const Bus &bus, byte address) + throw (ProtocolException) = 0; + virtual void writeRegister(const Bus &bus, byte address, + unsigned int value) throw (ProtocolException) = 0; + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/IrradCalProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/IrradCalProtocolInterface.h new file mode 100644 index 0000000..d9bbdab --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/IrradCalProtocolInterface.h @@ -0,0 +1,82 @@ +/***************************************************//** + * @file IrradCalProtocolInterface.h + * @date March 2010 + * @author Ocean Optics, Inc. + * + * This is a generic interface into irradiance calibration + * storage functionality at the protocol level, agnostic to + * any particular protocol. Each Protocol offering this + * functionality should implement this interface. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 IRRADCALPROTOCOLINTERFACE_H +#define IRRADCALPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class IrradCalProtocolInterface : public ProtocolHelper { + public: + IrradCalProtocolInterface(Protocol *protocol); + virtual ~IrradCalProtocolInterface(); + + /** + * Get the irradiance calibration from the device. + */ + virtual std::vector *readIrradCal(const Bus &bus) + throw (ProtocolException) = 0; + /** + * Write a new irradiance calibration to the device. + */ + virtual int writeIrradCal(const Bus &bus, const std::vector &cal) + throw (ProtocolException) = 0; + + /** + * Determine whether the device has a stored irradiance collection area. + * This will trap any exceptions so it is always safe to call. + */ + virtual int hasCollectionArea(const Bus &bus) = 0; + + /** + * Get the irradiance collection area from the device. + */ + virtual float readCollectionArea(const Bus &bus) + throw (ProtocolException) = 0; + + /** + * Write a new irradiance collection area to the device. + */ + virtual void writeCollectionArea(const Bus &bus, float area) + throw (ProtocolException) = 0; + + }; + +} + +#endif /* IRRADCALPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/LightSourceProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/LightSourceProtocolInterface.h new file mode 100644 index 0000000..068765f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/LightSourceProtocolInterface.h @@ -0,0 +1,95 @@ +/***************************************************//** + * @file LightSourceProtocolInterface.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 LIGHTSOURCEPROTOCOLINTERFACE_H +#define LIGHTSOURCEPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class LightSourceProtocolInterface : public ProtocolHelper { + public: + LightSourceProtocolInterface(Protocol *proto); + virtual ~LightSourceProtocolInterface(); + + virtual bool hasLightSourceEnable(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual bool isLightSourceEnabled(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual bool hasVariableIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual void setLightSourceEnable(const Bus &bus, int moduleIndex, + int lightSourceIndex, bool enable) throw (ProtocolException) = 0; + }; + + class LightSourceProtocolInterface_NormalizedIntensity { + public: + LightSourceProtocolInterface_NormalizedIntensity(); + virtual ~LightSourceProtocolInterface_NormalizedIntensity(); + + virtual double getIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual void setIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex, double intensity) throw (ProtocolException) = 0; + + virtual double getIntensityMinimum(const Bus &bus, int moduleIndex, + int lightSourceIndex) = 0; + + virtual double getIntensityMaximum(const Bus &bus, int moduleIndex, + int lightSourceIndex) = 0; + }; + + class LightSourceProtocolInterface_Counts { + public: + LightSourceProtocolInterface_Counts(); + virtual ~LightSourceProtocolInterface_Counts(); + + virtual int getIntensityCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual int getIntensityMinimumCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual int getIntensityMaximumCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException) = 0; + + virtual void setIntensityCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex, int counts) throw (ProtocolException) = 0; + }; + +} + +#endif /* LIGHTSOURCEPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/NonlinearityCoeffsProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/NonlinearityCoeffsProtocolInterface.h new file mode 100644 index 0000000..9136e5a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/NonlinearityCoeffsProtocolInterface.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file NonlinearityCoeffsProtocolInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * nonlinearity calibrations on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 NONLINEARITYCOEFFSPROTOCOLINTERFACE_H +#define NONLINEARITYCOEFFSPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class NonlinearityCoeffsProtocolInterface : public ProtocolHelper { + public: + NonlinearityCoeffsProtocolInterface(Protocol *protocol); + virtual ~NonlinearityCoeffsProtocolInterface(); + virtual std::vector *readNonlinearityCoeffs(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* NONLINEARITYCOEFFSPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/OpticalBenchProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/OpticalBenchProtocolInterface.h new file mode 100644 index 0000000..0ca98f8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/OpticalBenchProtocolInterface.h @@ -0,0 +1,73 @@ +/***************************************************//** + * @file OpticalBenchProtocolInterface.h + * @date Janaure 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * Optical Bench Parameters on an Ocean Optics device. + * + * This does not extend Protocol or otherwise read involved + * in that hierarchy because it might interfere with the + * lookup process for readting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * 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 OPTICALBENCHPROTOCOLINTERFACE_H +#define OPTICALBENCHPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class OpticalBenchProtocolInterface : public ProtocolHelper { + public: + OpticalBenchProtocolInterface(Protocol *protocol); + virtual ~OpticalBenchProtocolInterface(); + virtual std::string *readOpticalBenchID(const Bus &bus) + throw (ProtocolException) = 0; + virtual std::string *readOpticalBenchSerialNumber(const Bus &bus) + throw (ProtocolException) = 0; + virtual unsigned short int readOpticalBenchSlitWidthMicrons(const Bus &bus) + throw (ProtocolException) = 0; + virtual unsigned short int readOpticalBenchFiberDiameterMicrons(const Bus &bus) + throw (ProtocolException) = 0; + virtual std::string *readOpticalBenchGrating(const Bus &bus) + throw (ProtocolException) = 0; + virtual std::string *readOpticalBenchFilter(const Bus &bus) + throw (ProtocolException) = 0; + virtual std::string *readOpticalBenchCoating(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* OPTICALBENCHPROTOCOLINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/PixelBinningProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/PixelBinningProtocolInterface.h new file mode 100644 index 0000000..19cebeb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/PixelBinningProtocolInterface.h @@ -0,0 +1,87 @@ +/***************************************************//** + * @file PixelBinningProtocolInterface.h + * @date October 2015 + * @author Ocean Optics, Inc. + * + * This is a generic interface into thermoelectric functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * 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 PIXELBINNINGPROTOCOLINTERFACE_H +#define PIXELBINNINGPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class PixelBinningProtocolInterface : public ProtocolHelper { + public: + PixelBinningProtocolInterface(Protocol *protocol); + virtual ~PixelBinningProtocolInterface(); + + /** + * Get the pixel binning factor of the device. + */ + virtual unsigned char readPixelBinningFactor(const Bus &bus) + throw (ProtocolException) = 0; + + /** + * Set the pixel binning factor on the device. + */ + virtual void writePixelBinningFactor(const Bus &bus, const unsigned char binningFactor) + throw (ProtocolException) = 0; + + /** + * Get the default pixel binning factor of the device. + */ + virtual unsigned char readDefaultPixelBinningFactor(const Bus &bus) + throw (ProtocolException) = 0; + + /** + * Set the default pixel binning factor on the device. + */ + virtual void writeDefaultPixelBinningFactor(const Bus &bus, const unsigned char binningFactor) + throw (ProtocolException) = 0; + + /** + * Reset the default pixel binning factor on the device. This will reinstate the factory default of 0. + */ + virtual void writeDefaultPixelBinningFactor(const Bus &bus) + throw (ProtocolException) = 0; + + /** + * Get the maximum pixel binning factor of the device. + */ + virtual unsigned char readMaxPixelBinningFactor(const Bus &bus) + throw (ProtocolException) = 0; + }; +} + +#endif /* PIXELBINNINGPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ProgrammableSaturationProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ProgrammableSaturationProtocolInterface.h new file mode 100644 index 0000000..ff0d75b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ProgrammableSaturationProtocolInterface.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file ProgrammableSaturationProtocolInterface.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 PROGRAMMABLESATURATIONPROTOCOLINTERFACE_H +#define PROGRAMMABLESATURATIONPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class ProgrammableSaturationProtocolInterface : public ProtocolHelper { + public: + ProgrammableSaturationProtocolInterface(Protocol *protocol); + virtual ~ProgrammableSaturationProtocolInterface(); + + virtual unsigned int getSaturation(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} /* end namespace seabreeze */ + +#endif /* PROGRAMMABLESATURATIONPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/RevisionProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/RevisionProtocolInterface.h new file mode 100644 index 0000000..c8fc925 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/RevisionProtocolInterface.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file RevisionProtocolInterface.h + * @date Janaure 2015 + * @author Kirk Clendinning, Heliospectra + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * temperature sensors on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * 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 REVISIONPROTOCOLINTERFACE_H +#define REVISIONPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class RevisionProtocolInterface : public ProtocolHelper { + public: + RevisionProtocolInterface(Protocol *protocol); + virtual ~RevisionProtocolInterface(); + + virtual unsigned char readHardwareRevision(const Bus &bus) + throw (ProtocolException) = 0; + + virtual unsigned short int readFirmwareRevision(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* REVISIONPROTOCOLINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SerialNumberProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SerialNumberProtocolInterface.h new file mode 100644 index 0000000..8124705 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SerialNumberProtocolInterface.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file SerialNumberProtocolInterface.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * serial numbers on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SERIALNUMBERPROTOCOLINTERFACE_H +#define SERIALNUMBERPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + + class SerialNumberProtocolInterface : public ProtocolHelper { + public: + SerialNumberProtocolInterface(Protocol *protocol); + virtual ~SerialNumberProtocolInterface(); + virtual std::string *readSerialNumber(const Bus &bus) + throw (ProtocolException) = 0; + virtual unsigned char readSerialNumberMaximumLength(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* SERIALNUMBERPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ShutterProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ShutterProtocolInterface.h new file mode 100644 index 0000000..47118c8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ShutterProtocolInterface.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file ShutterProtocolInterface.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * a built-in shutter on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SHUTTERPROTOCOLINTERFACE_H +#define SHUTTERPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class ShutterProtocolInterface : public ProtocolHelper { + public: + ShutterProtocolInterface(Protocol *protocol); + virtual ~ShutterProtocolInterface(); + virtual void setShutterOpen(const Bus &bus, bool opened) + throw (ProtocolException) = 0; + }; + +} + +#endif /* SHUTTERPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrometerProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrometerProtocolInterface.h new file mode 100644 index 0000000..87c0a10 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrometerProtocolInterface.h @@ -0,0 +1,64 @@ +/***************************************************//** + * @file SpectrometerProtocolInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a generic interface into spectrometer functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 SPECTROMETERPROTOCOLINTERFACE_H +#define SPECTROMETERPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" +#include "vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h" +#include + +namespace seabreeze { + + class SpectrometerProtocolInterface : public ProtocolHelper { + public: + SpectrometerProtocolInterface(Protocol *protocol); + virtual ~SpectrometerProtocolInterface(); + virtual std::vector *readUnformattedSpectrum(const Bus &bus) + throw (ProtocolException) = 0; + virtual std::vector *readSpectrum(const Bus &bus) + throw (ProtocolException) = 0; + virtual void requestSpectrum(const Bus &bus) throw (ProtocolException) = 0; + virtual void setIntegrationTimeMicros(const Bus &bus, + unsigned long time_usec) throw (ProtocolException) = 0; + virtual void setTriggerMode(const Bus &bus, + SpectrometerTriggerMode &mode) throw (ProtocolException) = 0; + }; + +} + +#endif /* SPECTROMETERPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrumProcessingProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrumProcessingProtocolInterface.h new file mode 100644 index 0000000..a31a93d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/SpectrumProcessingProtocolInterface.h @@ -0,0 +1,67 @@ +/***************************************************//** + * @file SpectrumProcessingProtocolInterface.h + * @date February 2015 + * @author Kirk Clendinning, Heliospectra + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * spectrum processing features on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * 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 SPECTRUMPROCESSINGPROTOCOLINTERFACE_H +#define SPECTRUMPROCESSINGPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class SpectrumProcessingProtocolInterface : public ProtocolHelper { + public: + SpectrumProcessingProtocolInterface(Protocol *protocol); + virtual ~SpectrumProcessingProtocolInterface(); + virtual unsigned char readSpectrumProcessingBoxcarWidth(const Bus &bus) + throw (ProtocolException) = 0; + virtual unsigned short int readSpectrumProcessingScansToAverage(const Bus &bus) + throw (ProtocolException) = 0; + virtual void writeSpectrumProcessingBoxcarWidth(const Bus &bus, unsigned char boxcarWidth) + throw (ProtocolException) = 0; + virtual void writeSpectrumProcessingScansToAverage(const Bus &bus, unsigned short int scansToAverage) + throw (ProtocolException) = 0; + }; + +} + +#endif /* SPECTRUMPROCESSINGPROTOCOLINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrayLightCoeffsProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrayLightCoeffsProtocolInterface.h new file mode 100644 index 0000000..f5e4acb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrayLightCoeffsProtocolInterface.h @@ -0,0 +1,61 @@ +/***************************************************//** + * @file StrayLightCoeffsProtocolInterface.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * stray light calibrations on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STRAYLIGHTCOEFFSPROTOCOLINTERFACE_H +#define STRAYLIGHTCOEFFSPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + + class StrayLightCoeffsProtocolInterface : public ProtocolHelper { + public: + StrayLightCoeffsProtocolInterface(Protocol *protocol); + virtual ~StrayLightCoeffsProtocolInterface(); + virtual std::vector *readStrayLightCoeffs(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* STRAYLIGHTCOEFFSPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrobeLampProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrobeLampProtocolInterface.h new file mode 100644 index 0000000..d2e10c7 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/StrobeLampProtocolInterface.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file StrobeLampProtocolInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a generic interface into lamp functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 STROBELAMPPROTOCOLINTERFACE_H +#define STROBELAMPPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class StrobeLampProtocolInterface : public ProtocolHelper { + public: + StrobeLampProtocolInterface(Protocol *proto); + virtual ~StrobeLampProtocolInterface(); + virtual void setStrobeLampEnable(const Bus &bus, bool enable) + throw (ProtocolException) = 0; + }; + +} + +#endif /* LAMPPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/TemperatureProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/TemperatureProtocolInterface.h new file mode 100644 index 0000000..64adf98 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/TemperatureProtocolInterface.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file TemperatureProtocolInterface.h + * @date Janaure 2015 + * @author Kirk Clendinning, Heliospectra + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * temperature sensors on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * 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 TEMPERATUREPROTOCOLINTERFACE_H +#define TEMPERATUREPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class TemperatureProtocolInterface : public ProtocolHelper { + public: + TemperatureProtocolInterface(Protocol *protocol); + virtual ~TemperatureProtocolInterface(); + virtual unsigned char readTemperatureCount(const Bus &bus) + throw (ProtocolException) = 0; + virtual double readTemperature(const Bus &bus, int index) + throw (ProtocolException) = 0; + virtual std::vector *readAllTemperatures(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* TEMPERATUREPROTOCOLINTERFACE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ThermoElectricProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ThermoElectricProtocolInterface.h new file mode 100644 index 0000000..66e4737 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/ThermoElectricProtocolInterface.h @@ -0,0 +1,73 @@ +/***************************************************//** + * @file ThermoElectricProtocolInterface.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a generic interface into thermoelectric functionality + * at the protocol level, agnostic to any particular protocol. + * Each Protocol offering this functionality should implement + * this interface. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 THERMOELECTRICPROTOCOLINTERFACE_H +#define THERMOELECTRICPROTOCOLINTERFACE_H + +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" + +namespace seabreeze { + + class ThermoElectricProtocolInterface : public ProtocolHelper { + public: + ThermoElectricProtocolInterface(Protocol *protocol); + virtual ~ThermoElectricProtocolInterface(); + + /** + * Get the temperature of the thermoelectric device. + */ + virtual double readThermoElectricTemperatureCelsius(const Bus &bus) + throw (ProtocolException) = 0; + + /** + * Enable the thermoelectric unit on the device. + */ + virtual void writeThermoElectricEnable(const Bus &bus, bool enable) + throw (ProtocolException) = 0; + + /** + * Set the target temperature for the thermoelectric in degrees + * Celsius. The actual temperature that the device + * can reach may be a function of ambient temperature. + */ + virtual void writeThermoElectricSetPointCelsius(const Bus &bus, double degreesC) + throw (ProtocolException) = 0; + + }; + +} + +#endif /* THERMOELECTRICPROTOCOLINTERFACE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/WaveCalProtocolInterface.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/WaveCalProtocolInterface.h new file mode 100644 index 0000000..47af129 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/interfaces/WaveCalProtocolInterface.h @@ -0,0 +1,62 @@ +/***************************************************//** + * @file WaveCalProtocolInterface.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * This is a simple interface for any protocol to implement + * that provides a protocol-agnostic mechanism for accessing + * wavelength calibrations on an Ocean Optics device. + * + * This does not extend Protocol or otherwise get involved + * in that hierarchy because it might interfere with the + * lookup process for getting a Protocol object to delegate + * these methods to. Worse, it could end up inheriting + * twice from the same base class, which is just messy. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 WAVECALPROTOCOLINTERFACE_H +#define WAVECALPROTOCOLINTERFACE_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "common/protocols/ProtocolHelper.h" +#include + +namespace seabreeze { + + class WaveCalProtocolInterface : public ProtocolHelper { + public: + WaveCalProtocolInterface(Protocol *protocol); + virtual ~WaveCalProtocolInterface(); + virtual std::vector *readWavelengthCoeffs(const Bus &bus) + throw (ProtocolException) = 0; + }; + +} + +#endif /* WAVECALPROTOCOLINTERFACE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/constants/OBPMessageTypes.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/constants/OBPMessageTypes.h new file mode 100644 index 0000000..ac5275d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/constants/OBPMessageTypes.h @@ -0,0 +1,166 @@ +/***************************************************//** + * @file OBPMessageTypes.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * This class contains legal values for the messageType + * field in the OBPMessage class. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPMESSAGETYPES_H +#define OBPMESSAGETYPES_H + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPMessageTypes { + public: +// Basic hardware and firmware information +// static const unsigned int OBP_RESET = 0x00000000; +// static const unsigned int OBP_RESET_DEFAULTS = 0x00000001; + static const unsigned int OBP_GET_HARDWARE_REVISION = 0x00000080; + static const unsigned int OBP_GET_FIRMWARE_REVISION = 0x00000090; + static const unsigned int OBP_GET_SERIAL_NUMBER = 0x00000100; + static const unsigned int OBP_GET_SERIAL_NUMBER_LENGTH = 0x00000101; + static const unsigned int OBP_GET_DEVICE_ALIAS = 0x00000200; + static const unsigned int OBP_GET_DEVICE_ALIAS_LENGTH = 0x00000201; + static const unsigned int OBP_SET_DEVICE_ALIAS = 0x00000210; + static const unsigned int OBP_GET_USER_STRING_COUNT = 0x00000300; + static const unsigned int OBP_GET_USER_STRING_LENGTH = 0x00000301; + static const unsigned int OBP_GET_USER_STRING = 0x00000302; + static const unsigned int OBP_SET_USER_STRING = 0x00000310; + +// Serial Interface + static const unsigned int OBP_GET_RS232_BAUD_RATE = 0x00000800; + static const unsigned int OBP_GET_RS232_FLOW_COTROL_MODE = 0x00000804; + static const unsigned int OBP_SET_RS232_BAUD_RATE = 0x00000810; + static const unsigned int OBP_SET_RS232_FLOW_COTROL_MODE = 0x00000814; + static const unsigned int OBP_GET_RS232_SAVE_SETTINGS = 0x000008F0; + +// Miscellaneous + static const unsigned int OBP_CONFIGURE_STATUS_LED = 0x00001010; +// static const unsigned int OBP_ENTER_REPROGRAMMING_MODE = 0x000FFF00; + + +// Buffering + static const unsigned int OBP_GET_BUFFER_SIZE_MAX = 0x00100820; + static const unsigned int OBP_GET_BUFFER_SIZE_ACTIVE = 0x00100822; + static const unsigned int OBP_CLEAR_BUFFER_ALL = 0x00100830; + static const unsigned int OBP_SET_BUFFER_SIZE_ACTIVE = 0x00100832; + static const unsigned int OBP_GET_BUFFERED_SPEC_COUNT = 0x00100900; + +//Spectra queries + static const unsigned int OBP_GET_BUF_SPEC32_META = 0x00100928; + static const unsigned int OBP_GET_CORRECTED_SPECTRUM_NOW = 0x00101000; + static const unsigned int OBP_GET_SATURATION_LEVEL = 0x001010A0; + static const unsigned int OBP_GET_RAW_SPECTRUM_NOW = 0x00101100; + static const unsigned int OBP_GET_PARTIAL_SPECTRUM_MODE = 0x00102000; + static const unsigned int OBP_SET_PARTIAL_SPECTRUM_MODE = 0x00102010; + static const unsigned int OBP_GET_PARTIAL_SPECTRUM_NOW = 0x00102080; + +// Integration, binning, lamps, shutters etc. + static const unsigned int OBP_SET_ITIME_USEC = 0x00110010; + static const unsigned int OBP_SET_TRIG_MODE = 0x00110110; + static const unsigned int OBP_SIMULATE_TRIG_PULSE = 0x00110120; + static const unsigned int OBP_GET_PIXEL_BINNING_FACTOR = 0x00110280; + static const unsigned int OBP_GET_MAX_BINNING_FACTOR = 0x00110281; + static const unsigned int OBP_GET_DEFAULT_BINNING_FACTOR = 0x00110285; + static const unsigned int OBP_SET_PIXEL_BINNING_FACTOR = 0x00110290; + static const unsigned int OBP_SET_DEFAULT_BINNING_FACTOR = 0x00110295; + static const unsigned int OBP_SET_LAMP_ENABLE = 0x00110410; + static const unsigned int OBP_SET_TRIG_DELAY_USEC = 0x00110510; + static const unsigned int OBP_SET_SHUTTER = 0x00110610; + +// Spectrum filtering and averaging + static const unsigned int OBP_GET_SCANS_TO_AVERAGE = 0x00120000; + static const unsigned int OBP_SET_SCANS_TO_AVERAGE = 0x00120010; + static const unsigned int OBP_GET_BOXCAR_WIDTH = 0x00121000; + static const unsigned int OBP_SET_BOXCAR_WIDTH = 0x00121010; + +// Spectral correction and calibration + static const unsigned int OBP_GET_WL_COEFF_COUNT = 0x00180100; + static const unsigned int OBP_GET_WL_COEFF = 0x00180101; + static const unsigned int OBP_SET_WL_COEFF = 0x00180111; + static const unsigned int OBP_GET_NL_COEFF_COUNT = 0x00181100; + static const unsigned int OBP_GET_NL_COEFF = 0x00181101; + static const unsigned int OBP_SET_NL_COEFF = 0x00181111; + static const unsigned int OBP_GET_IRRAD_CAL_ALL = 0x00182001; + static const unsigned int OBP_GET_IRRAD_CAL_COUNT = 0x00182002; + static const unsigned int OBP_GET_IRRAD_CAL_COLL_AREA = 0x00182003; + static const unsigned int OBP_SET_IRRAD_CAL_ALL = 0x00182011; + static const unsigned int OBP_SET_IRRAD_CAL_COLL_AREA = 0x00182013; + static const unsigned int OBP_GET_STRAY_COEFF_COUNT = 0x00183100; + static const unsigned int OBP_GET_STRAY_COEFF = 0x00183101; + static const unsigned int OBP_SET_STRAY_COEFF = 0x00183111; + static const unsigned int OBP_SPEC_GET_HOT_PIXEL_INDICES = 0x00186000; + static const unsigned int OBP_SPEC_SET_HOT_PIXEL_INDICES = 0x00186010; + +// Optical Bench + static const unsigned int OBP_GET_BENCH_ID = 0x001B0000; + static const unsigned int OBP_GET_BENCH_SERIAL_NUMBER = 0x001B0100; + static const unsigned int OBP_GET_BENCH_SLIT_WIDTH_MICRONS = 0x001B0200; + static const unsigned int OBP_GET_BENCH_FIBER_DIAM_MICRONS = 0x001B0300; + static const unsigned int OBP_GET_BENCH_GRATING = 0x001B0400; + static const unsigned int OBP_GET_BENCH_FILTER = 0x001B0500; + static const unsigned int OBP_GET_BENCH_COATING = 0x001B0600; + +// GPIO + static const unsigned int OBP_GET_GPIO_NUMBER_OF_PINS = 0x00200000; + static const unsigned int OBP_GET_GPIO_OUTPUT_ENABLE_VECTOR = 0x00200100; + static const unsigned int OBP_SET_GPIO_OUTPUT_ENABLE_VECTOR = 0x00200110; + static const unsigned int OBP_GET_GPIO_VALUE = 0x00200300; + static const unsigned int OBP_SET_GPIO_VALUE = 0x00200310; + +// Strobe + static const unsigned int OBP_SET_SINGLE_STROBE_DELAY = 0x00300010; + static const unsigned int OBP_SET_SINGLE_STROBE_WIDTH = 0x00300011; + static const unsigned int OBP_SET_SINGLE_STROBE_ENABLE = 0x00300012; + static const unsigned int OBP_SET_CONT_STROBE_PERIOD = 0x00310010; + static const unsigned int OBP_SET_CONT_STROBE_ENABLE = 0x00310011; + +// Temperature control and sensing + static const unsigned int OBP_GET_TEMPERATURE_COUNT = 0x00400000; + static const unsigned int OBP_GET_TEMPERATURE = 0x00400001; + static const unsigned int OBP_GET_TEMPERATURE_ALL = 0x00400002; + static const unsigned int OBP_GET_TE_ENABLE = 0x00420000; + static const unsigned int OBP_GET_TE_SETPOINT = 0x00420001; + static const unsigned int OBP_GET_TE_FAN_ENABLE = 0x00420002; + static const unsigned int OBP_GET_TE_IS_STABLE = 0x00420003; + static const unsigned int OBP_GET_TE_TEMPERATURE = 0x00420004; + static const unsigned int OBP_SET_TE_ENABLE = 0x00420010; + static const unsigned int OBP_SET_TE_SETPOINT = 0x00420011; + static const unsigned int OBP_SET_TE_FAN_ENABLE = 0x00420012; + +// light source control + static const unsigned int OBP_GET_LIGHT_SOURCE_ENABLE = 0x00810021; + static const unsigned int OBP_SET_LIGHT_SOURCE_ENABLE = 0x00810031; + static const unsigned int OBP_GET_LIGHT_SOURCE_INTENSITY = 0x00810041; + static const unsigned int OBP_SET_LIGHT_SOURCE_INTENSITY = 0x00810051; + }; + } +} + +#endif /* OBPMESSAGETYPES_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h new file mode 100644 index 0000000..bf143c6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPCommand.h + * @date May 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPCOMMAND_H +#define OBPCOMMAND_H + +#include +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPTransaction.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPCommand : public OBPTransaction { + public: + OBPCommand(); + virtual ~OBPCommand(); + + using OBPTransaction::sendCommandToDevice; + virtual bool sendCommandToDevice(TransferHelper *helper) throw (ProtocolException); + + protected: + int messageType; + std::vector payload; + }; + } +} + +#endif /* OBPCOMMAND_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobeEnableExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobeEnableExchange.h new file mode 100644 index 0000000..ef968bd --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobeEnableExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPContinuousStrobeEnableExchange.h + * @date February 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPCONTINUOUS_STROBE_ENABLE_EXCHANGE_H +#define OBPCONTINUOUS_STROBE_ENABLE_EXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPContinuousStrobeEnableExchange : public OBPCommand { + public: + OBPContinuousStrobeEnableExchange(); + virtual ~OBPContinuousStrobeEnableExchange(); + void setContinuousStrobeEnable(bool enable); + }; + } +} + +#endif /* OBPCONTINUOUS_STROBE_ENABLE_EXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobePeriodExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobePeriodExchange.h new file mode 100644 index 0000000..4a9fcb6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobePeriodExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPContinuousStrobePeriodExchange.h + * @date February 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPCONTINUOUS_STROBE_PERIOD_EXCHANGE_H +#define OBPCONTINUOUS_STROBE_PERIOD_EXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPContinuousStrobePeriodExchange : public OBPCommand { + public: + OBPContinuousStrobePeriodExchange(); + virtual ~OBPContinuousStrobePeriodExchange(); + void setContinuousStrobePeriodMicroseconds(unsigned long period_usec); + }; + } +} + +#endif /* OBPCONTINUOUS_STROBE_PERIOD_EXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPDataBufferClearExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPDataBufferClearExchange.h new file mode 100644 index 0000000..e4dd76c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPDataBufferClearExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPDataBufferClearExchange.h + * @date October 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 OBPDATABUFFERCLEAREXCHANGE_H +#define OBPDATABUFFERCLEAREXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPDataBufferClearExchange : public OBPCommand { + public: + OBPDataBufferClearExchange(); + virtual ~OBPDataBufferClearExchange(); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPDATABUFFERCLEAREXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetAllTemperaturesExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetAllTemperaturesExchange.h new file mode 100644 index 0000000..5a7b4c2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetAllTemperaturesExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetAllTemperaturesExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETALLTEMPERATURESEXCHANGE_H +#define OBPGETALLTEMPERATURESEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetAllTemperaturesExchange : public OBPQuery { + public: + OBPGetAllTemperaturesExchange(); + virtual ~OBPGetAllTemperaturesExchange(); + }; + } +} + +#endif /* OBPGETALLTEMPERATURESEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetBoxcarWidthExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetBoxcarWidthExchange.h new file mode 100644 index 0000000..c586f7f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetBoxcarWidthExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetBoxcarWidthExchange.h + * @date February 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETBOXCARWIDTHEXCHANGE_H +#define OBPGETBOXCARWIDTHEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetBoxcarWidthExchange : public OBPQuery { + public: + OBPGetBoxcarWidthExchange(); + virtual ~OBPGetBoxcarWidthExchange(); + }; + } +} + +#endif /* OBPGETBOXCARWIDTHEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferCapacityExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferCapacityExchange.h new file mode 100644 index 0000000..006e4d6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferCapacityExchange.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file OBPGetDataBufferCapacityExchange.h + * @date October 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 OBPGETDATABUFFERCAPACITYEXCHANGE_H +#define OBPGETDATABUFFERCAPACITYEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetDataBufferCapacityExchange : public OBPQuery { + public: + OBPGetDataBufferCapacityExchange(); + virtual ~OBPGetDataBufferCapacityExchange(); + + unsigned long queryBufferCapacity(TransferHelper *helper) + throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPGETDATABUFFERCAPACITYEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferElementCountExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferElementCountExchange.h new file mode 100644 index 0000000..7bf4ceb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferElementCountExchange.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file OBPGetDataBufferElementCountExchange.h + * @date October 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 OBPGETDATABUFFERELEMENTCOUNTEXCHANGE_H +#define OBPGETDATABUFFERELEMENTCOUNTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetDataBufferElementCountExchange : public OBPQuery { + public: + OBPGetDataBufferElementCountExchange(); + virtual ~OBPGetDataBufferElementCountExchange(); + + unsigned long queryNumberOfElements(TransferHelper *helper) + throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPGETDATABUFFERELEMENTCOUNTEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferMaximumCapacityExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferMaximumCapacityExchange.h new file mode 100644 index 0000000..f1bebfc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDataBufferMaximumCapacityExchange.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file OBPGetDataBufferMaximumCapacityExchange.h + * @date October 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 OBPGETDATABUFFERMAXIMUMCAPACITYEXCHANGE_H +#define OBPGETDATABUFFERMAXIMUMCAPACITYEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetDataBufferMaximumCapacityExchange : public OBPQuery { + public: + OBPGetDataBufferMaximumCapacityExchange(); + virtual ~OBPGetDataBufferMaximumCapacityExchange(); + + unsigned long queryBufferMaximumCapacity( + TransferHelper *helper) throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPGETDATABUFFERMAXIMUMCAPACITYEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDefaultPixelBinningExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDefaultPixelBinningExchange.h new file mode 100644 index 0000000..0726a85 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetDefaultPixelBinningExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPGetDefaultPixelBinningExchange.h + * @date October 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 OBPGETDEFAULTPIXELBINNINGEXCHANGE_H +#define OBPGETDEFAULTPIXELBINNINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetDefaultPixelBinningExchange : public OBPQuery { + public: + OBPGetDefaultPixelBinningExchange(); + virtual ~OBPGetDefaultPixelBinningExchange(); + unsigned char getDefaultPixelBinningFactor(); + }; + } +} + +#endif /* OBPGETDEFAULTPIXELBINNINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetFirmwareRevisionExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetFirmwareRevisionExchange.h new file mode 100644 index 0000000..73ddbcf --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetFirmwareRevisionExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetFirmwareRevisionExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETFIRMWAREREVISIONEXCHANGE_H +#define OBPGETFIRMWAREREVISIONEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetFirmwareRevisionExchange : public OBPQuery { + public: + OBPGetFirmwareRevisionExchange(); + virtual ~OBPGetFirmwareRevisionExchange(); + }; + } +} + +#endif /* OBPGETFIRMWAREREVISIONEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetHardwareRevisionExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetHardwareRevisionExchange.h new file mode 100644 index 0000000..f24b906 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetHardwareRevisionExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetHardwareRevisionExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETHARDWAREREVISIONEXCHANGE_H +#define OBPGETHARDWAREREVISIONEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetHardwareRevisionExchange : public OBPQuery { + public: + OBPGetHardwareRevisionExchange(); + virtual ~OBPGetHardwareRevisionExchange(); + }; + } +} + +#endif /* OBPGETHARDWAREREVISIONEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCalExchange.h new file mode 100644 index 0000000..af9b3ea --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCalExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetIrradCalExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETIRRADCALEXCHANGE_H +#define OBPGETIRRADCALEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetIrradCalExchange : public OBPQuery { + public: + OBPGetIrradCalExchange(); + virtual ~OBPGetIrradCalExchange(); + }; + } +} + +#endif /* OBPGETIRRADCALEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCollectionAreaExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCollectionAreaExchange.h new file mode 100644 index 0000000..b8e03c9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetIrradCollectionAreaExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetIrradCollectionAreaExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETIRRADCOLLECTIONAREAEXCHANGE_H +#define OBPGETIRRADCOLLECTIONAREAEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetIrradCollectionAreaExchange : public OBPQuery { + public: + OBPGetIrradCollectionAreaExchange(); + virtual ~OBPGetIrradCollectionAreaExchange(); + }; + } +} + +#endif /* OBPGETIRRADCOLLECTIONAREAEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetMaxPixelBinningExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetMaxPixelBinningExchange.h new file mode 100644 index 0000000..dd19e5b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetMaxPixelBinningExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPGetMaxPixelBinningExchange.h + * @date October 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 OBPGETMAXPIXELBINNINGEXCHANGE_H +#define OBPGETMAXPIXELBINNINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetMaxPixelBinningExchange : public OBPQuery { + public: + OBPGetMaxPixelBinningExchange(); + virtual ~OBPGetMaxPixelBinningExchange(); + unsigned char getMaxPixelBinningFactor(); + }; + } +} + +#endif /* OBPGETMAXPIXELBINNINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffExchange.h new file mode 100644 index 0000000..77f5840 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffExchange.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OBPGetNonlinearityCoeffExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETNONLINEARITYCOEFFEXCHANGE_H +#define OBPGETNONLINEARITYCOEFFEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetNonlinearityCoeffExchange : public OBPQuery { + public: + OBPGetNonlinearityCoeffExchange(); + virtual ~OBPGetNonlinearityCoeffExchange(); + + void setCoefficientIndex(unsigned int index); + }; + } +} + +#endif /* OBPGETNONLINEARITYCOEFFEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffsCountExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffsCountExchange.h new file mode 100644 index 0000000..315e673 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetNonlinearityCoeffsCountExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetNonlinearityCoeffsCountExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETNONLINEARITYCOEFFSCOUNTEXCHANGE_H +#define OBPGETNONLINEARITYCOEFFSCOUNTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetNonlinearityCoeffsCountExchange : public OBPQuery { + public: + OBPGetNonlinearityCoeffsCountExchange(); + virtual ~OBPGetNonlinearityCoeffsCountExchange(); + }; + } +} + +#endif /* OBPGETNONLINEARITYCOEFFSCOUNTEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchCoatingExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchCoatingExchange.h new file mode 100644 index 0000000..e6964d4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchCoatingExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchCoatingExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning + * + * 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 OBPGETOPTICALBENCHCOATINGEXCHANGE_H +#define OBPGETOPTICALBENCHCOATINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchCoatingExchange : public OBPQuery { + public: + OBPGetOpticalBenchCoatingExchange(); + virtual ~OBPGetOpticalBenchCoatingExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHCOATINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFiberDiameterMicronsExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFiberDiameterMicronsExchange.h new file mode 100644 index 0000000..268a2ee --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFiberDiameterMicronsExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchFiberDiameterMicronsExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHFIBERDIAMETERMIRCONSEXCHANGE_H +#define OBPGETOPTICALBENCHFIBERDIAMETERMIRCONSEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchFiberDiameterMicronsExchange : public OBPQuery { + public: + OBPGetOpticalBenchFiberDiameterMicronsExchange(); + virtual ~OBPGetOpticalBenchFiberDiameterMicronsExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHFIBERDIAMETERMIRCONSEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFilterExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFilterExchange.h new file mode 100644 index 0000000..c314138 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchFilterExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchFilterExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHFILTEREXCHANGE_H +#define OBPGETOPTICALBENCHFILTEREXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchFilterExchange : public OBPQuery { + public: + OBPGetOpticalBenchFilterExchange(); + virtual ~OBPGetOpticalBenchFilterExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHFILTEREXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchGratingExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchGratingExchange.h new file mode 100644 index 0000000..1bb9b07 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchGratingExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchGratingExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHGRATINGEXCHANGE_H +#define OBPGETOPTICALBENCHGRATINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchGratingExchange : public OBPQuery { + public: + OBPGetOpticalBenchGratingExchange(); + virtual ~OBPGetOpticalBenchGratingExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHGRATINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchIDExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchIDExchange.h new file mode 100644 index 0000000..725430d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchIDExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchIDExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHIDEXCHANGE_H +#define OBPGETOPTICALBENCHIDEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchIDExchange : public OBPQuery { + public: + OBPGetOpticalBenchIDExchange(); + virtual ~OBPGetOpticalBenchIDExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHIDEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSerialNumberExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSerialNumberExchange.h new file mode 100644 index 0000000..75b862c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSerialNumberExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchSerialNumberExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHSERIALNUMBEREXCHANGE_H +#define OBPGETOPTICALBENCHSERIALNUMBEREXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchSerialNumberExchange : public OBPQuery { + public: + OBPGetOpticalBenchSerialNumberExchange(); + virtual ~OBPGetOpticalBenchSerialNumberExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHSERIALNUMBEREXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSlitWidthMicronsExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSlitWidthMicronsExchange.h new file mode 100644 index 0000000..87aa8d6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetOpticalBenchSlitWidthMicronsExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetOpticalBenchSlitWidthMicronsExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETOPTICALBENCHSLITWIDTHMIRCONSEXCHANGE_H +#define OBPGETOPTICALBENCHSLITWIDTHMIRCONSEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetOpticalBenchSlitWidthMicronsExchange : public OBPQuery { + public: + OBPGetOpticalBenchSlitWidthMicronsExchange(); + virtual ~OBPGetOpticalBenchSlitWidthMicronsExchange(); + }; + } +} + +#endif /* OBPGETOPTICALBENCHSLITWIDTHMIRCONSEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetPixelBinningExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetPixelBinningExchange.h new file mode 100644 index 0000000..bc1c40b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetPixelBinningExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPGetPixelBinningExchange.h + * @date October 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 OBPGETPIXELBINNINGEXCHANGE_H +#define OBPGETPIXELBINNINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetPixelBinningExchange : public OBPQuery { + public: + OBPGetPixelBinningExchange(); + virtual ~OBPGetPixelBinningExchange(); + unsigned char getPixelBinningFactor(); + }; + } +} + +#endif /* OBPGETPIXELBINNINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSaturationExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSaturationExchange.h new file mode 100644 index 0000000..0b7d015 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSaturationExchange.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file OBPGetSaturationExchange.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPGETSATURATIONEXCHANGE_H +#define OBPGETSATURATIONEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetSaturationExchange : public OBPQuery { + public: + OBPGetSaturationExchange(); + virtual ~OBPGetSaturationExchange(); + + unsigned int querySaturationLevel(TransferHelper *helper) + throw (ProtocolException); + }; + } +} + +#endif /* OBPGETSATURATIONEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetScansToAverageExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetScansToAverageExchange.h new file mode 100644 index 0000000..184b91e --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetScansToAverageExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetScansToAverageExchange.h + * @date February 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETSCANSTOAVERAGEEXCHANGE_H +#define OBPGETSCANSTOAVERAGEEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetScansToAverageExchange : public OBPQuery { + public: + OBPGetScansToAverageExchange(); + virtual ~OBPGetScansToAverageExchange(); + }; + } +} + +#endif /* OBPGETSCANSTOAVERAGEEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberExchange.h new file mode 100644 index 0000000..62e82e1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetSerialNumberExchange.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETSERIALNUMBEREXCHANGE_H +#define OBPGETSERIALNUMBEREXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetSerialNumberExchange : public OBPQuery { + public: + OBPGetSerialNumberExchange(); + virtual ~OBPGetSerialNumberExchange(); + }; + } +} + +#endif /* OBPGETSERIALNUMBEREXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberMaximumLengthExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberMaximumLengthExchange.h new file mode 100644 index 0000000..25aaa52 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetSerialNumberMaximumLengthExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetSerialNumberMaximumLengthExchange.h + * @date Janaury 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPGETSERIALNUMBERMAXIMUMLENGTHEXCHANGE_H +#define OBPGETSERIALNUMBERMAXIMUMLENGTHEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetSerialNumberMaximumLengthExchange : public OBPQuery { + public: + OBPGetSerialNumberMaximumLengthExchange(); + virtual ~OBPGetSerialNumberMaximumLengthExchange(); + }; + } +} + +#endif /* OBPGETSERIALNUMBERMAXIMUMLENGTHEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffExchange.h new file mode 100644 index 0000000..d301f3c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffExchange.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OBPGetStrayLightCoeffExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETSTRAYLIGHTCOEFFEXCHANGE_H +#define OBPGETSTRAYLIGHTCOEFFEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetStrayLightCoeffExchange : public OBPQuery { + public: + OBPGetStrayLightCoeffExchange(); + virtual ~OBPGetStrayLightCoeffExchange(); + + void setCoefficientIndex(unsigned int index); + }; + } +} + +#endif /* OBPGETSTRAYLIGHTCOEFFEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffsCountExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffsCountExchange.h new file mode 100644 index 0000000..71d4edf --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetStrayLightCoeffsCountExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetStrayLightCoeffsCountExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETSTRAYLIGHTCOEFFSCOUNTEXCHANGE_H +#define OBPGETSTRAYLIGHTCOEFFSCOUNTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetStrayLightCoeffsCountExchange : public OBPQuery { + public: + OBPGetStrayLightCoeffsCountExchange(); + virtual ~OBPGetStrayLightCoeffsCountExchange(); + }; + } +} + +#endif /* OBPGETSTRAYLIGHTCOEFFSCOUNTEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureCountExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureCountExchange.h new file mode 100644 index 0000000..b2aa762 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureCountExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetTemperatureCountExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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 OBPGETTEMPERATURECOUNTEXCHANGE_H +#define OBPGETTEMPERATURECOUNTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetTemperatureCountExchange : public OBPQuery { + public: + OBPGetTemperatureCountExchange(); + virtual ~OBPGetTemperatureCountExchange(); + }; + } +} + +#endif /* OBPGETTEMPERATURECOUNTEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureExchange.h new file mode 100644 index 0000000..8008932 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetTemperatureExchange.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OBPGetTemperatureExchange.h + * @date January 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETTEMPERATUREEXCHANGE_H +#define OBPGETTEMPERATUREEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetTemperatureExchange : public OBPQuery { + public: + OBPGetTemperatureExchange(); + virtual ~OBPGetTemperatureExchange(); + + void setTemperatureIndex(unsigned int index); + }; + } +} + +#endif /* OBPGETTEMPERATUREEXCHANGE_H */ \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetThermoElectricTemperatureExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetThermoElectricTemperatureExchange.h new file mode 100644 index 0000000..dc287ff --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetThermoElectricTemperatureExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPGetThermoElectricTemperatureExchange.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETTHERMOELECTRICTEMPERATUREEXCHANGE_H +#define OBPGETTHERMOELECTRICTEMPERATUREEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetThermoElectricTemperatureExchange : public OBPQuery { + public: + OBPGetThermoElectricTemperatureExchange(); + virtual ~OBPGetThermoElectricTemperatureExchange(); + }; + } +} + +#endif /* OBPGETTHERMOELECTRICTEMPERATUREEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetWaveCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetWaveCalExchange.h new file mode 100644 index 0000000..b317dfc --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPGetWaveCalExchange.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file OBPGetWaveCalExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPGETWAVECALEXCHANGE_H +#define OBPGETWAVECALEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPGetWaveCalExchange : public OBPQuery { + public: + OBPGetWaveCalExchange(); + virtual ~OBPGetWaveCalExchange(); + + void setCoefficientIndex(unsigned int index); + }; + } +} + +#endif /* OBPGETWAVECALEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPIntegrationTimeExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPIntegrationTimeExchange.h new file mode 100644 index 0000000..d83ab16 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPIntegrationTimeExchange.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OBPIntegrationTimeExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPINTEGRATIONTIMEEXCHANGE_H +#define OBPINTEGRATIONTIMEEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPIntegrationTimeExchange : public OBPCommand { + public: + OBPIntegrationTimeExchange(unsigned long integrationTimeBase_usec); + virtual ~OBPIntegrationTimeExchange(); + void setIntegrationTimeMicros(unsigned long integrationTime_usec); + + private: + unsigned long integrationTimeBase_usec; + unsigned long integrationTime_usec; + }; + } +} + +#endif /* OBPINTEGRATIONTIMEEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLampEnableCommand.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLampEnableCommand.h new file mode 100644 index 0000000..9c376d1 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLampEnableCommand.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file OBPLampEnableCommand.cpp + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPLAMPENABLECOMMAND_H +#define OBPLAMPENABLECOMMAND_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPLampEnableCommand : public OBPCommand { + public: + OBPLampEnableCommand(); + virtual ~OBPLampEnableCommand(); + + void setEnable(TransferHelper *helper, bool enable) + throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + + +#endif /* OBPLAMPENABLECOMMAND_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnableCommand.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnableCommand.h new file mode 100644 index 0000000..245109f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnableCommand.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file OBPLightSourceEnableCommand.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPLIGHTSOURCEENABLECOMMAND_H +#define OBPLIGHTSOURCEENABLECOMMAND_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceEnableCommand : public OBPCommand { + public: + OBPLightSourceEnableCommand(); + virtual ~OBPLightSourceEnableCommand(); + + virtual void setLightSourceEnable(int moduleIndex, int source, bool enable); + }; + + } +} + +#endif /* OBPLIGHTSOURCEENABLECOMMAND_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnabledQuery.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnabledQuery.h new file mode 100644 index 0000000..82d618c --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceEnabledQuery.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPLightSourceEnabledQuery.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPLIGHTSOURCEENABLEDQUERY_H +#define OBPLIGHTSOURCEENABLEDQUERY_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceEnabledQuery : public OBPQuery { + public: + OBPLightSourceEnabledQuery(int module, int source); + virtual ~OBPLightSourceEnabledQuery(); + + bool queryEnable(TransferHelper *helper) throw (ProtocolException); + + private: + int moduleIndex; + int lightSourceIndex; + }; + + } +} + +#endif /* OBPLIGHTSOURCEENABLEDQUERY_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityCommand.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityCommand.h new file mode 100644 index 0000000..07eb3e7 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityCommand.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file OBPLightSourceIntensityCommand.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPLIGHTSOURCEINTENSITYCOMMAND_H +#define OBPLIGHTSOURCEINTENSITYCOMMAND_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceIntensityCommand : public OBPCommand { + public: + OBPLightSourceIntensityCommand(); + virtual ~OBPLightSourceIntensityCommand(); + + virtual void setLightSourceIntensity(int moduleIndex, int source, + float intensity); + }; + + } +} + +#endif /* OBPLIGHTSOURCEINTENSITYCOMMAND_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityQuery.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityQuery.h new file mode 100644 index 0000000..e53a3bd --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPLightSourceIntensityQuery.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPLightSourceIntensityQuery.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPLIGHTSOURCEINTENSITYQUERY_H +#define OBPLIGHTSOURCEINTENSITYQUERY_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceIntensityQuery : public OBPQuery { + public: + OBPLightSourceIntensityQuery(int module, int source); + virtual ~OBPLightSourceIntensityQuery(); + + float queryIntensity(TransferHelper *helper) throw (ProtocolException); + + private: + int moduleIndex; + int lightSourceIndex; + }; + + } +} + +#endif /* OBPLIGHTSOURCEINTENSITYQUERY_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h new file mode 100644 index 0000000..fc6d557 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h @@ -0,0 +1,105 @@ +/***************************************************//** + * @file OBPMessage.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * All messages in the Ocean Binary Protocol begin with + * a standard 64-byte header. It is always safe to read + * 64 bytes for the start of a new transfer from a device + * that supports this protocol, which works nicely with + * the USB minimum packet size. + * + * This class simplifies the task of getting data into + * and out of the header. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPMESSAGE_H +#define OBPMESSAGE_H + +#include +#include "common/SeaBreeze.h" +#include "common/exceptions/IllegalArgumentException.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPMessage { + public: + OBPMessage(); + ~OBPMessage(); + + static OBPMessage *parseHeaderFromByteStream(std::vector *stream) throw (IllegalArgumentException); + static OBPMessage *parseByteStream(std::vector *stream) throw (IllegalArgumentException); + + std::vector *toByteStream(); + std::vector *getData(); + unsigned int getBytesRemaining(); + byte getChecksumType(); + unsigned short getErrno(); + unsigned short getFlags(); + std::vector *getImmediateData(); + byte getImmediateDataLength(); + unsigned int getMessageType(); + std::vector *getPayload(); + unsigned short getProtocolVersion(); + unsigned int getRegarding(); + + bool isAckFlagSet(); + bool isNackFlagSet(); + + void setAckRequestedFlag(); + void setBytesRemaining(unsigned int bytesRemaining); + void setChecksumType(byte checksumType); + void setData(std::vector *data); + void setErrorNumber(unsigned short errorNumber); + void setFlags(unsigned short flags); + void setImmediateData(std::vector *immediateData); + void setImmediateDataLength(byte immediateDataLength); + void setMessageType(unsigned int messageType); + void setPayload(std::vector *payload); + void setProtocolVersion(unsigned short protocolVersion); + void setRegarding(unsigned int regarding); + + protected: + void setupMessage(); + std::vector *header; + unsigned short protocolVersion; + unsigned short flags; + unsigned short errorNumber; + unsigned int messageType; + unsigned int regarding; + byte checksumType; + byte immediateDataLength; + std::vector *immediateData; + unsigned int bytesRemaining; + std::vector *payload; + std::vector *checksum; + std::vector *footer; + }; + + } +} + +#endif /* OBPMESSAGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h new file mode 100644 index 0000000..679a860 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPQuery.h + * @date May 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPQUERY_H +#define OBPQUERY_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPTransaction.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPQuery : public OBPTransaction { + public: + OBPQuery(); + virtual ~OBPQuery(); + + using OBPTransaction::queryDevice; + virtual std::vector *queryDevice(TransferHelper *helper) throw (ProtocolException) ; + + protected: + int messageType; + std::vector payload; + }; + } +} + +#endif /* OBPQUERY_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrum32AndMetadataExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrum32AndMetadataExchange.h new file mode 100644 index 0000000..bca0170 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrum32AndMetadataExchange.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file OBPReadRawSpectrum32AndMetadataExchange.h + * @date September 2013 + * @author Ocean Optics, Inc. + * + * This message type is intended for the QE-PRO which + * aligns pixel data to 32-bit words and includes a + * metadata block at the start of each spectrum. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREADRAWSPECTRUM32ANDMETADATAEXCHANGE_H +#define OBPREADRAWSPECTRUM32ANDMETADATAEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPReadRawSpectrum32AndMetadataExchange : public Transfer { + public: + OBPReadRawSpectrum32AndMetadataExchange(unsigned int numberOfPixels); + virtual ~OBPReadRawSpectrum32AndMetadataExchange(); + + void setNumberOfPixels(int numberOfPixels); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + unsigned int isLegalMessageType(unsigned int t); + unsigned int numberOfPixels; + unsigned int metadataLength; + }; + } +} + +#endif /* OBPREADRAWSPECTRUM32ANDMETADATAEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrumExchange.h new file mode 100644 index 0000000..ebc0304 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrumExchange.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file OBPReadRawSpectrumExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREADRAWSPECTRUMEXCHANGE_H +#define OBPREADRAWSPECTRUMEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPReadRawSpectrumExchange : public Transfer { + public: + OBPReadRawSpectrumExchange(unsigned int readoutLength, unsigned int numberOfPixels); + virtual ~OBPReadRawSpectrumExchange(); + + // Allow the number of pixels to be altered for pixel binning + void setNumberOfPixels(unsigned int readoutLength, unsigned int numPixels); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + unsigned int isLegalMessageType(unsigned int t); + unsigned int numberOfPixels; + }; + } +} + +#endif /* OBPREADRAWSPECTRUMEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrum32AndMetadataExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrum32AndMetadataExchange.h new file mode 100644 index 0000000..c7dc738 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrum32AndMetadataExchange.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file OBPReadSpectrum32AndMetadataExchange.h + * @date September 2013 + * @author Ocean Optics, Inc. + * + * This message type is intended for the QE-PRO which + * aligns pixel data to 32-bit words and includes a + * metadata block at the start of each spectrum. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREADSPECTRUM32ANDMETADATAEXCHANGE_H +#define OBPREADSPECTRUM32ANDMETADATAEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrum32AndMetadataExchange.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPReadSpectrum32AndMetadataExchange + : public OBPReadRawSpectrum32AndMetadataExchange { + + public: + OBPReadSpectrum32AndMetadataExchange(unsigned int numberOfPixels); + virtual ~OBPReadSpectrum32AndMetadataExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif /* OBPREADSPECTRUM32ANDMETADATAEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumExchange.h new file mode 100644 index 0000000..cbc564b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumExchange.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file OBPReadSpectrumExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREADSPECTRUMEXCHANGE_H +#define OBPREADSPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPReadRawSpectrumExchange.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPReadSpectrumExchange : public OBPReadRawSpectrumExchange { + public: + OBPReadSpectrumExchange(unsigned int readoutLength, unsigned int numberOfPixels); + virtual ~OBPReadSpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif /* OBPREADSPECTRUMEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumWithGainExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumWithGainExchange.h new file mode 100644 index 0000000..c8488a0 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumWithGainExchange.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPReadSpectrumWithGainExchange.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPREADSPECTRUMWITHGAINEXCHANGE_H +#define OBPREADSPECTRUMWITHGAINEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumExchange.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPReadSpectrumWithGainExchange : public OBPReadSpectrumExchange { + public: + OBPReadSpectrumWithGainExchange(unsigned int readoutLength, + unsigned int numberOfPixels, GainAdjustedSpectrometerFeature *spec); + virtual ~OBPReadSpectrumWithGainExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif /* OBPREADSPECTRUMWITHGAINEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestBufferedSpectrum32AndMetadataExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestBufferedSpectrum32AndMetadataExchange.h new file mode 100644 index 0000000..d5c5992 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestBufferedSpectrum32AndMetadataExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPRequestBufferedSpectrum32AndMetadataExchange.h + * @date September 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREQUESTBUFFEREDSPECTRUM32ANDMETADATAEXCHANGE_H +#define OBPREQUESTBUFFEREDSPECTRUM32ANDMETADATAEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPRequestBufferedSpectrum32AndMetadataExchange : public Transfer { + public: + OBPRequestBufferedSpectrum32AndMetadataExchange(); + virtual ~OBPRequestBufferedSpectrum32AndMetadataExchange(); + }; + } +} + +#endif /* OBPREQUESTBUFFEREDSPECTRUM32ANDMETADATAEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestRawSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestRawSpectrumExchange.h new file mode 100644 index 0000000..596b461 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestRawSpectrumExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPRequestRawSpectrumExchange.h + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPREQUESTRAWSPECTRUMEXCHANGE_H +#define OBPREQUESTRAWSPECTRUMEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPRequestRawSpectrumExchange : public Transfer { + public: + OBPRequestRawSpectrumExchange(); + virtual ~OBPRequestRawSpectrumExchange(); + }; + } +} + +#endif /* OBPREQUESTRAWSPECTRUMEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestSpectrumExchange.h new file mode 100644 index 0000000..6c6fef0 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPRequestSpectrumExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPRequestSpectrumExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPREQUESTSPECTRUMEXCHANGE_H +#define OBPREQUESTSPECTRUMEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPRequestSpectrumExchange : public Transfer { + public: + OBPRequestSpectrumExchange(); + virtual ~OBPRequestSpectrumExchange(); + }; + } +} + +#endif /* OBPREQUESTSPECTRUMEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetAcquisitionDelayExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetAcquisitionDelayExchange.h new file mode 100644 index 0000000..d7aa956 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetAcquisitionDelayExchange.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file OBPSetAcquisitionDelayExchange.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 OBPSETACQUISITIONDELAYEXCHANGE_H +#define OBPSETACQUISITIONDELAYEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPSetAcquisitionDelayExchange : public OBPCommand { + public: + OBPSetAcquisitionDelayExchange(); + virtual ~OBPSetAcquisitionDelayExchange(); + + void setAcquisitionDelayMicros(unsigned long delayMicros); + }; + + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPSETACQUISITIONDELAYEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetBoxcarWidthExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetBoxcarWidthExchange.h new file mode 100644 index 0000000..5d01977 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetBoxcarWidthExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetBoxcarWidthExchange.h + * @date Februayr 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPSETBOXCARWIDTHEXCHANGE_H +#define OBPSETBOXCARWIDTHEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetBoxcarWidthExchange : public OBPCommand { + public: + OBPSetBoxcarWidthExchange(); + virtual ~OBPSetBoxcarWidthExchange(); + void setBoxcarWidth(unsigned char boxcarWidth); + }; + } +} + +#endif /* OBPSETBOXCARWIDTHEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDataBufferCapacityExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDataBufferCapacityExchange.h new file mode 100644 index 0000000..f991292 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDataBufferCapacityExchange.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file OBPSetDataBufferCapacityExchange.h + * @date October 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 OBPSETDATABUFFERCAPACITYEXCHANGE_H +#define OBPSETDATABUFFERCAPACITYEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetDataBufferCapacityExchange : public OBPCommand { + public: + OBPSetDataBufferCapacityExchange(); + virtual ~OBPSetDataBufferCapacityExchange(); + + void setBufferCapacity(unsigned long capacity); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPSETDATABUFFERCAPACITYEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDefaultPixelBinningExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDefaultPixelBinningExchange.h new file mode 100644 index 0000000..95934da --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetDefaultPixelBinningExchange.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OBPSetDefaultPixelBinningExchange.h + * @date October 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 OBPSETDEFAULTPIXELBINNINGEXCHANGE_H +#define OBPSETDEFAULTPIXELBINNINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetDefaultPixelBinningExchange : public OBPCommand { + public: + OBPSetDefaultPixelBinningExchange(); + virtual ~OBPSetDefaultPixelBinningExchange(); + void setDefaultPixelBinningFactor(const unsigned char binning); + void setDefaultPixelBinningFactor(); + }; + } +} + +#endif /* OBPSETDEFAULTPIXELBINNINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCalExchange.h new file mode 100644 index 0000000..2bd55db --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCalExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetIrradCalExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSETIRRADCALEXCHANGE_H +#define OBPSETIRRADCALEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetIrradCalExchange : public OBPCommand { + public: + OBPSetIrradCalExchange(int maximumPixels); + virtual ~OBPSetIrradCalExchange(); + void setIrradianceCalibration(std::vector &values); + }; + } +} + +#endif /* OBPSETIRRADCALEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCollectionAreaExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCollectionAreaExchange.h new file mode 100644 index 0000000..289e2f6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetIrradCollectionAreaExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetIrradCollectionAreaExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSETIRRADCOLLECTIONAREAEXCHANGE_H +#define OBPSETIRRADCOLLECTIONAREAEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetIrradCollectionAreaExchange : public OBPCommand { + public: + OBPSetIrradCollectionAreaExchange(); + virtual ~OBPSetIrradCollectionAreaExchange(); + void setCollectionArea(float area); + }; + } +} + +#endif /* OBPSETIRRADCOLLECTIONAREAEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetPixelBinningExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetPixelBinningExchange.h new file mode 100644 index 0000000..0f2d6fb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetPixelBinningExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetPixelBinningExchange.h + * @date October 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 OBPSETPIXELBINNINGEXCHANGE_H +#define OBPSETPIXELBINNINGEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetPixelBinningExchange : public OBPCommand { + public: + OBPSetPixelBinningExchange(); + virtual ~OBPSetPixelBinningExchange(); + void setPixelBinningFactor(const unsigned char binning); + }; + } +} + +#endif /* OBPSETPIXELBINNINGEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetScansToAverageExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetScansToAverageExchange.h new file mode 100644 index 0000000..d07fd74 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetScansToAverageExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetScansToAverageExchange.h + * @date Februayr 2015 + * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra + * + * 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 OBPSETSCANSTOAVERAGEEXCHANGE_H +#define OBPSETSCANSTOAVERAGEEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetScansToAverageExchange : public OBPCommand { + public: + OBPSetScansToAverageExchange(); + virtual ~OBPSetScansToAverageExchange(); + void setScansToAverage(unsigned short int scansToAverage); + }; + } +} + +#endif /* OBPSETSCANSTOAVERAGEEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricEnableExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricEnableExchange.h new file mode 100644 index 0000000..f848bed --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricEnableExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetThermoElectricEnableExchange.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSETTHERMOELECTRICENABLEEXCHANGE_H +#define OBPSETTHERMOELECTRICENABLEEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetThermoElectricEnableExchange : public OBPCommand { + public: + OBPSetThermoElectricEnableExchange(); + virtual ~OBPSetThermoElectricEnableExchange(); + void setThermoElectricEnable(bool enable); + }; + } +} + +#endif /* OBPSETTHERMOELECTRICENABLEEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricSetpointExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricSetpointExchange.h new file mode 100644 index 0000000..bef32d9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPSetThermoElectricSetpointExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPSetThermoElectricSetpointExchange.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSETTHERMOELECTRICSETPOINTEXCHANGE_H +#define OBPSETTHERMOELECTRICSETPOINTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSetThermoElectricSetpointExchange : public OBPCommand { + public: + OBPSetThermoElectricSetpointExchange(); + virtual ~OBPSetThermoElectricSetpointExchange(); + void setThermoElectricSetpointCelsius(float setpoint); + }; + } +} + +#endif /* OBPSETTHERMOELECTRICSETPOINTEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPShutterExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPShutterExchange.h new file mode 100644 index 0000000..7c56fcf --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPShutterExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file OBPShutterExchange.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSHUTTEREXCHANGE_H +#define OBPSHUTTEREXCHANGE_H + +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPShutterExchange : public OBPCommand { + public: + OBPShutterExchange(); + virtual ~OBPShutterExchange(); + void setShutterOpen(bool openShutter); + }; + } +} + +#endif /* OBPSHUTTEREXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTransaction.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTransaction.h new file mode 100644 index 0000000..8238eae --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTransaction.h @@ -0,0 +1,84 @@ +/***************************************************//** + * @file OBPTransaction.h + * @date March 2011 + * @author Ocean Optics, Inc. + * + * All messages in the Ocean Binary Protocol begin with + * a standard 64-byte header. It is always safe to read + * 64 bytes for the start of a new transfer from a device + * that supports this protocol, which works nicely with + * the USB minimum packet size. + * + * This class simplifies the task of performing transactions + * with the device, where a command is always followed + * by a response. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPTRANSACTION_H +#define OBPTRANSACTION_H + +#include +#include "common/buses/TransferHelper.h" +#include "common/protocols/ProtocolHint.h" +#include "common/exceptions/ProtocolException.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPTransaction { + public: + OBPTransaction(); + virtual ~OBPTransaction(); + + virtual const std::vector &getHints(); + + protected: + /* This creates a message of the given type and payload and sends it + * to the device. The reply is formatted into a byte vector. Any + * errors will be indicated via an exception. + */ + virtual std::vector *queryDevice(TransferHelper *helper, + unsigned int messageType, + std::vector &data) throw (ProtocolException); + + /* This creates a message of the given type and payload and sends it + * to the device. No response (other than an acknowledgment) is + * expected. This will return true if the command was acknowledged + * correctly, or false if there was a negative acknowledgment (NACK). Note + * that some commands will normally return a NACK even though it was + * a correct command (e.g. trying to read out a calibration that does + * not exist) so this does not throw an exception on a NACK. + */ + virtual bool sendCommandToDevice(TransferHelper *helper, + unsigned int messageType, + std::vector &data) throw (ProtocolException); + + std::vector *hints; + }; + } +} + +#endif /* OBPTRANSACTION_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTriggerModeExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTriggerModeExchange.h new file mode 100644 index 0000000..620f2db --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/exchanges/OBPTriggerModeExchange.h @@ -0,0 +1,47 @@ +/***************************************************//** + * @file OBPTriggerModeExchange.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPTRIGGERMODEEXCHANGE_H +#define OBPTRIGGERMODEEXCHANGE_H + +#include "vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPCommand.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPTriggerModeExchange : public OBPCommand { + public: + OBPTriggerModeExchange(); + virtual ~OBPTriggerModeExchange(); + void setTriggerMode(SpectrometerTriggerMode &mode); + }; + } +} + +#endif /* OBPTRIGGERMODEEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPControlHint.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPControlHint.h new file mode 100644 index 0000000..81e91c4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPControlHint.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPControlHint.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPCONTROLHINT_H +#define OBPCONTROLHINT_H + +#include "common/protocols/ProtocolHint.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPControlHint : public ProtocolHint { + public: + OBPControlHint(); + virtual ~OBPControlHint(); + }; + } +} + +#endif /* OBPCONTROLHINT_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPSpectrumHint.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPSpectrumHint.h new file mode 100644 index 0000000..34c149f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/hints/OBPSpectrumHint.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file OBPSpectrumHint.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSPECTRUMHINT_H +#define OBPSPECTRUMHINT_H + +#include "common/protocols/ProtocolHint.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSpectrumHint : public ProtocolHint { + public: + OBPSpectrumHint(); + virtual ~OBPSpectrumHint(); + }; + } +} + +#endif /* OBPSPECTRUMHINT_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPAcquisitionDelayProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPAcquisitionDelayProtocol.h new file mode 100644 index 0000000..b26c0e6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPAcquisitionDelayProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OBPAcquisitionDelayProtocol.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 OBPACQUISITIONDELAYPROTOCOL_H +#define OBPACQUISITIONDELAYPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/AcquisitionDelayProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPAcquisitionDelayProtocol : public AcquisitionDelayProtocolInterface { + public: + OBPAcquisitionDelayProtocol(); + virtual ~OBPAcquisitionDelayProtocol(); + + virtual void setAcquisitionDelayMicroseconds(const Bus &bus, + const unsigned long delayMicros) throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPACQUISITIONDELAYPROTOCOL_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPContinuousStrobeProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPContinuousStrobeProtocol.h new file mode 100644 index 0000000..b0db171 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPContinuousStrobeProtocol.h @@ -0,0 +1,60 @@ +/***************************************************//** + * @file OBPContinuousStrobeProtocol.h + * @date February 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPCONTINUOUS_STROBE_PROTOCOL_H +#define OBPCONTINUOUS_STROBE_PROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobePeriodExchange.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPContinuousStrobeEnableExchange.h" +#include "vendors/OceanOptics/protocols/interfaces/ContinuousStrobeProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPContinuousStrobeProtocol : public ContinuousStrobeProtocolInterface { + public: + OBPContinuousStrobeProtocol(); + virtual ~OBPContinuousStrobeProtocol(); + + virtual void setContinuousStrobePeriodMicroseconds(const Bus &bus, + unsigned short strobe_id, unsigned long period_usec) + throw (ProtocolException); + virtual void setContinuousStrobeEnable(const Bus &bus, + unsigned short strobe_id, bool enable) + throw (ProtocolException); + + protected: + OBPContinuousStrobePeriodExchange *setPeriodExchange; + OBPContinuousStrobeEnableExchange *setEnableExchange; + }; + } +} + +#endif /* OBPCONTINUOUS_STROBE_PROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPDataBufferProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPDataBufferProtocol.h new file mode 100644 index 0000000..918434b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPDataBufferProtocol.h @@ -0,0 +1,71 @@ +/***************************************************//** + * @file OBPDataBufferProtocol.h + * @date October 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 OBPDATABUFFERPROTOCOL_H +#define OBPDATABUFFERPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/DataBufferProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPDataBufferProtocol : public DataBufferProtocolInterface { + public: + OBPDataBufferProtocol(); + virtual ~OBPDataBufferProtocol(); + + virtual void clearBuffer(const Bus &bus, unsigned char bufferIndex) + throw (ProtocolException); + + virtual unsigned long getNumberOfElements(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException); + + virtual unsigned long getBufferCapacity(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException); + + virtual unsigned long getBufferCapacityMinimum(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException); + + virtual unsigned long getBufferCapacityMaximum(const Bus &bus, + unsigned char bufferIndex) + throw (ProtocolException); + + virtual void setBufferCapacity(const Bus &bus, + unsigned char bufferIndex, + const unsigned long capacity) + throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPDATABUFFERPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPIrradCalProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPIrradCalProtocol.h new file mode 100644 index 0000000..417f63d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPIrradCalProtocol.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file OBPIrradCalProtocol.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPIRRADCALPROTOCOL_H +#define OBPIRRADCALPROTOCOL_H + +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/IrradCalProtocolInterface.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPIrradCalProtocol : public IrradCalProtocolInterface { + public: + OBPIrradCalProtocol(int maximumNumberOfPixels); + + virtual ~OBPIrradCalProtocol(); + + /* Inherited from IrradCalProtocolInterface */ + virtual std::vector *readIrradCal(const Bus &bus) + throw (ProtocolException); + virtual int writeIrradCal(const Bus &bus, const std::vector &cal) + throw (ProtocolException); + virtual int hasCollectionArea(const Bus &bus); + virtual float readCollectionArea(const Bus &bus) + throw (ProtocolException); + virtual void writeCollectionArea(const Bus &bus, float area) + throw (ProtocolException); + + private: + unsigned int pixelCountMaximum; + + }; + } +} + +#endif /* OBPIRRADCALPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol.h new file mode 100644 index 0000000..57c9f44 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol.h @@ -0,0 +1,86 @@ +/***************************************************//** + * @file OBPLightSourceProtocol.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OBPLIGHTSOURCEPROTOCOL_H +#define SEABREEZE_OBPLIGHTSOURCEPROTOCOL_H + +#include "vendors/OceanOptics/protocols/interfaces/LightSourceProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceProtocol : public LightSourceProtocolInterface { + + public: + OBPLightSourceProtocol(); + virtual ~OBPLightSourceProtocol(); + + /* Required by LightSourceProtocolInterface */ + virtual bool isLightSourceEnabled(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException); + + virtual void setLightSourceEnable(const Bus &bus, int moduleIndex, + int lightSourceIndex, bool enable) throw (ProtocolException); + + protected: + virtual int getModuleCount() = 0; + virtual int getLightSourceCount(int moduleIndex) = 0; + + }; + + class OBPLightSourceProtocol_NormalizedIntensity : public OBPLightSourceProtocol, + public LightSourceProtocolInterface_NormalizedIntensity { + public: + OBPLightSourceProtocol_NormalizedIntensity(); + virtual ~OBPLightSourceProtocol_NormalizedIntensity(); + + virtual double getIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException); + + virtual void setIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex, double intensity) throw (ProtocolException); + }; + + class OBPLightSourceProtocol_Counts : public OBPLightSourceProtocol, + public LightSourceProtocolInterface_Counts { + public: + OBPLightSourceProtocol_Counts(); + virtual ~OBPLightSourceProtocol_Counts(); + + virtual int getIntensityCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException); + + virtual void setIntensityCounts(const Bus &bus, int moduleIndex, + int lightSourceIndex, int counts) throw (ProtocolException); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol_Ventana.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol_Ventana.h new file mode 100644 index 0000000..ec8727d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol_Ventana.h @@ -0,0 +1,66 @@ +/***************************************************//** + * @file OBPLightSourceProtocol_Ventana.h + * @date April 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OBPLIGHTSOURCEPROTOCOL_VENTANA_H +#define SEABREEZE_OBPLIGHTSOURCEPROTOCOL_VENTANA_H + +#include "vendors/OceanOptics/protocols/obp/impls/OBPLightSourceProtocol.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + + class OBPLightSourceProtocol_Ventana + : public OBPLightSourceProtocol_NormalizedIntensity { + public: + OBPLightSourceProtocol_Ventana(); + virtual ~OBPLightSourceProtocol_Ventana(); + + /* Required by OBPLightSourceProtocol */ + virtual int getModuleCount(); + virtual int getLightSourceCount(int moduleIndex); + + /* Required by LightSourceProtocolInterface */ + virtual bool hasLightSourceEnable(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException); + + virtual bool hasVariableIntensity(const Bus &bus, int moduleIndex, + int lightSourceIndex) throw (ProtocolException); + + /* Required by LightSourceProtocolInterface_NormalizedIntensity */ + virtual double getIntensityMinimum(const Bus &bus, int moduleIndex, + int lightSourceIndex); + + virtual double getIntensityMaximum(const Bus &bus, int moduleIndex, + int lightSourceIndex); + }; + + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPNonlinearityCoeffsProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPNonlinearityCoeffsProtocol.h new file mode 100644 index 0000000..eb10f75 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPNonlinearityCoeffsProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OBPNonlinearityCoeffsProtocol.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OBP_NONLINEARITYCOEFFSPROTOCOL_H +#define SEABREEZE_OBP_NONLINEARITYCOEFFSPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/NonlinearityCoeffsProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPNonlinearityCoeffsProtocol : public NonlinearityCoeffsProtocolInterface { + public: + OBPNonlinearityCoeffsProtocol(); + virtual ~OBPNonlinearityCoeffsProtocol(); + + virtual std::vector *readNonlinearityCoeffs(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPOpticalBenchProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPOpticalBenchProtocol.h new file mode 100644 index 0000000..fa273e8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPOpticalBenchProtocol.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file OBPOpticalBenchProtocol.h + * @date January 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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_OBP_OPTICAL_BENCHROTOCOL_H +#define SEABREEZE_OBP_OPTICAL_BENCHROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/OpticalBenchProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPOpticalBenchProtocol : public OpticalBenchProtocolInterface { + public: + OBPOpticalBenchProtocol(); + virtual ~OBPOpticalBenchProtocol(); + + virtual unsigned short int readOpticalBenchSlitWidthMicrons(const Bus &bus) + throw (ProtocolException); + virtual unsigned short int readOpticalBenchFiberDiameterMicrons(const Bus &bus) + throw (ProtocolException); + virtual std::string *readOpticalBenchID(const Bus &bus) + throw (ProtocolException); + virtual std::string *readOpticalBenchSerialNumber(const Bus &bus) + throw (ProtocolException); + virtual std::string *readOpticalBenchCoating(const Bus &bus) + throw (ProtocolException); + virtual std::string *readOpticalBenchFilter(const Bus &bus) + throw (ProtocolException); + virtual std::string *readOpticalBenchGrating(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPPixelBinningProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPPixelBinningProtocol.h new file mode 100644 index 0000000..e890fe6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPPixelBinningProtocol.h @@ -0,0 +1,84 @@ +/***************************************************//** + * @file OBPPixelBinningProtocol.h + * @date October 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 OBPPIXELBINNINGPROTOCOL_H +#define OBPPIXELBINNINGPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/PixelBinningProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPPixelBinningProtocol : public PixelBinningProtocolInterface { + public: + OBPPixelBinningProtocol(); + virtual ~OBPPixelBinningProtocol(); + + /** + * Get the pixel binning factor of the device. + */ + virtual unsigned char readPixelBinningFactor(const Bus &bus) + throw (ProtocolException); + + /** + * Set the pixel binning factor on the device. + */ + virtual void writePixelBinningFactor(const Bus &bus, const unsigned char binningFactor) + throw (ProtocolException); + + /** + * Get the default pixel binning factor of the device. + */ + virtual unsigned char readDefaultPixelBinningFactor(const Bus &bus) + throw (ProtocolException); + + /** + * Set the default pixel binning factor on the device. + */ + virtual void writeDefaultPixelBinningFactor(const Bus &bus, const unsigned char binningFactor) + throw (ProtocolException); + + /** + * Reset the default pixel binning factor on the device. This will reinstate the factory default of 0. + */ + virtual void writeDefaultPixelBinningFactor(const Bus &bus) + throw (ProtocolException); + + /** + * Get the maximum pixel binning factor of the device. + */ + virtual unsigned char readMaxPixelBinningFactor(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif /* OBPPIXELBINNINGPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPProgrammableSaturationProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPProgrammableSaturationProtocol.h new file mode 100644 index 0000000..01525f9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPProgrammableSaturationProtocol.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPProgrammableSaturationProtocol.h + * @date March 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPPROGRAMMABLESATURATIONPROTOCOL_H +#define OBPPROGRAMMABLESATURATIONPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/ProgrammableSaturationProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPProgrammableSaturationProtocol + : public ProgrammableSaturationProtocolInterface { + public: + OBPProgrammableSaturationProtocol(); + virtual ~OBPProgrammableSaturationProtocol(); + + /* Inherited from ProgrammableSaturationProtocolInterface */ + virtual unsigned int getSaturation(const Bus &bus) + throw (ProtocolException); + }; + } /* end namespace oceanBinaryProtocol */ +} /* end namespace seabreeze */ + +#endif /* OBPPROGRAMMABLESATURATIONPROTOCOL_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPRevisionProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPRevisionProtocol.h new file mode 100644 index 0000000..7f05484 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPRevisionProtocol.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file OBPRevisionProtocol.h + * @date January 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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_OBP_REVISIONPROTOCOL_H +#define SEABREEZE_OBP_REVISIONPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/RevisionProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPRevisionProtocol : public RevisionProtocolInterface { + public: + OBPRevisionProtocol(); + virtual ~OBPRevisionProtocol(); + + virtual unsigned char readHardwareRevision(const Bus &bus) + throw (ProtocolException); + + virtual unsigned short int readFirmwareRevision(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSerialNumberProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSerialNumberProtocol.h new file mode 100644 index 0000000..de9dcd6 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSerialNumberProtocol.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OBPSerialNumberProtocol.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSERIALNUMBERPROTOCOL_H +#define OBPSERIALNUMBERPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/SerialNumberProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSerialNumberProtocol : public SerialNumberProtocolInterface { + public: + OBPSerialNumberProtocol(); + virtual ~OBPSerialNumberProtocol(); + + virtual std::string *readSerialNumber(const Bus &bus) + throw (ProtocolException); + virtual unsigned char readSerialNumberMaximumLength(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif /* OBPSERIALNUMBERPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPShutterProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPShutterProtocol.h new file mode 100644 index 0000000..2b1a4b2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPShutterProtocol.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file OBPShutterProtocol.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSHUTTERPROTOCOL_H +#define OBPSHUTTERPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPShutterExchange.h" +#include "vendors/OceanOptics/protocols/interfaces/ShutterProtocolInterface.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPShutterProtocol : public ShutterProtocolInterface { + public: + OBPShutterProtocol(); + virtual ~OBPShutterProtocol(); + + virtual void setShutterOpen(const Bus &bus, bool opened) + throw (ProtocolException); + + protected: + OBPShutterExchange *shutterExchange; + }; + } +} + +#endif /* OBPSHUTTERPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrometerProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrometerProtocol.h new file mode 100644 index 0000000..69697d8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrometerProtocol.h @@ -0,0 +1,79 @@ +/***************************************************//** + * @file OBPSpectrometerProtocol.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPSPECTROMETERPROTOCOL_H +#define OBPSPECTROMETERPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/protocols/Transfer.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPIntegrationTimeExchange.h" +#include "vendors/OceanOptics/protocols/obp/exchanges/OBPTriggerModeExchange.h" +#include "vendors/OceanOptics/protocols/interfaces/SpectrometerProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSpectrometerProtocol : public SpectrometerProtocolInterface { + public: + OBPSpectrometerProtocol( + OBPIntegrationTimeExchange *integrationTimeExchange, + Transfer *requestSpectrumExchange, + Transfer *unformattedSpectrumExchange, + Transfer *spectrumTransferExchange, + OBPTriggerModeExchange *triggerMode); + virtual ~OBPSpectrometerProtocol(); + + /* FIXME: instead of returning primitive vectors, should this return Data* so that + * metadata (units, etc.) can also be attached? + */ + virtual std::vector *readUnformattedSpectrum(const Bus &bus) + throw (ProtocolException); + virtual std::vector *readSpectrum(const Bus &bus) + throw (ProtocolException); + virtual void requestSpectrum(const Bus &bus) throw (ProtocolException); + virtual void setIntegrationTimeMicros(const Bus &bus, + unsigned long time_usec) throw (ProtocolException); + virtual void setTriggerMode(const Bus &bus, + SpectrometerTriggerMode &mode) throw (ProtocolException); + + private: + OBPIntegrationTimeExchange *integrationTimeExchange; + /* These are Transfers instead of Exchanges so that we can call getHints() on them. + * if getHints is promoted up to the level of Exchange, then these can revert back. + */ + Transfer *unformattedSpectrumExchange; + Transfer *requestSpectrumExchange; + Transfer *spectrumTransferExchange; + OBPTriggerModeExchange *triggerModeExchange; + }; + } +} + +#endif /* OBPSPECTROMETERPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrumProcessingProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrumProcessingProtocol.h new file mode 100644 index 0000000..e953db4 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPSpectrumProcessingProtocol.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file OBPSpectrumProcessingProtocol.h + * @date February 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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_OBP_SPECTRUMPROCESSINGPROTOCOL_H +#define SEABREEZE_OBP_SPECTRUMPROCESSINGPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/SpectrumProcessingProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPSpectrumProcessingProtocol : public SpectrumProcessingProtocolInterface { + public: + OBPSpectrumProcessingProtocol(); + virtual ~OBPSpectrumProcessingProtocol(); + + virtual unsigned short int readSpectrumProcessingScansToAverage(const Bus &bus) + throw (ProtocolException); + virtual unsigned char readSpectrumProcessingBoxcarWidth(const Bus &bus) + throw (ProtocolException); + virtual void writeSpectrumProcessingScansToAverage(const Bus &bus, unsigned short int scansToAverage) + throw (ProtocolException); + virtual void writeSpectrumProcessingBoxcarWidth(const Bus &bus, unsigned char boxcarWidth) + throw (ProtocolException); + }; + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrayLightCoeffsProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrayLightCoeffsProtocol.h new file mode 100644 index 0000000..1ea14c9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrayLightCoeffsProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OBPStrayLightCoeffsProtocol.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OBP_STRAYLIGHTCOEFFSPROTOCOL_H +#define SEABREEZE_OBP_STRAYLIGHTCOEFFSPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/StrayLightCoeffsProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPStrayLightCoeffsProtocol : public StrayLightCoeffsProtocolInterface { + public: + OBPStrayLightCoeffsProtocol(); + virtual ~OBPStrayLightCoeffsProtocol(); + + virtual std::vector *readStrayLightCoeffs(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrobeLampProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrobeLampProtocol.h new file mode 100644 index 0000000..9401c99 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPStrobeLampProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OBPStrobeLampProtocol.cpp + * @date February 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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 OBPSTROBELAMPPROTOCOL_H +#define OBPSTROBELAMPPROTOCOL_H + +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/StrobeLampProtocolInterface.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPStrobeLampProtocol : public StrobeLampProtocolInterface { + public: + OBPStrobeLampProtocol(); + virtual ~OBPStrobeLampProtocol(); + + virtual void setStrobeLampEnable(const Bus &bus, bool enable) + throw (ProtocolException); + }; + } +} + +#endif /* OBPSTROBELAMPPROTOCOL_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPTemperatureProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPTemperatureProtocol.h new file mode 100644 index 0000000..24b5682 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPTemperatureProtocol.h @@ -0,0 +1,56 @@ +/***************************************************//** + * @file OBPTemperatureProtocol.h + * @date January 2015 + * @author Kirk Clendinning, Heliospectra + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2015, Ocean Optics Inc, Heliospectra AB + * + * 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_OBP_TEMPERATUREPROTOCOL_H +#define SEABREEZE_OBP_TEMPERATUREPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/TemperatureProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPTemperatureProtocol : public TemperatureProtocolInterface { + public: + OBPTemperatureProtocol(); + virtual ~OBPTemperatureProtocol(); + + virtual unsigned char readTemperatureCount(const Bus &bus) + throw (ProtocolException); + virtual double readTemperature(const Bus &bus, int index) + throw (ProtocolException); + + virtual std::vector *readAllTemperatures(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif \ No newline at end of file diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPThermoElectricProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPThermoElectricProtocol.h new file mode 100644 index 0000000..e5379ac --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPThermoElectricProtocol.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file OBPThermoElectricProtocol.h + * @date March 2013 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPTHERMOELECTRICPROTOCOL_H +#define OBPTHERMOELECTRICPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/ThermoElectricProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPThermoElectricProtocol : public ThermoElectricProtocolInterface { + public: + OBPThermoElectricProtocol(); + virtual ~OBPThermoElectricProtocol(); + + virtual double readThermoElectricTemperatureCelsius(const Bus &bus) + throw (ProtocolException); + + virtual void writeThermoElectricEnable(const Bus &bus, bool enable) + throw (ProtocolException); + + virtual void writeThermoElectricSetPointCelsius(const Bus &bus, + double degreesC) throw (ProtocolException); + }; + } +} + +#endif /* OBPTHERMOELECTRICPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPWaveCalProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPWaveCalProtocol.h new file mode 100644 index 0000000..06f7aa5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OBPWaveCalProtocol.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file OBPWaveCalProtocol.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OBPWAVECALPROTOCOL_H +#define OBPWAVECALPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/WaveCalProtocolInterface.h" +#include + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OBPWaveCalProtocol : public WaveCalProtocolInterface { + public: + OBPWaveCalProtocol(); + virtual ~OBPWaveCalProtocol(); + + virtual std::vector *readWavelengthCoeffs(const Bus &bus) + throw (ProtocolException); + }; + } +} + +#endif /* OBPWAVECALPROTOCOL_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OceanBinaryProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OceanBinaryProtocol.h new file mode 100644 index 0000000..294010a --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/obp/impls/OceanBinaryProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OceanBinaryProtocol.h + * @date January 2011 + * @author Ocean Optics, Inc. + * + * This provides a singleton object that identifies the + * Ocean Binary Protocol command set. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OCEANBINARYPROTOCOL_H +#define OCEANBINARYPROTOCOL_H + +#include "common/protocols/Protocol.h" + +namespace seabreeze { + namespace oceanBinaryProtocol { + class OceanBinaryProtocol : public Protocol { + public: + OceanBinaryProtocol(); + virtual ~OceanBinaryProtocol(); + + /* Must be overridden from Protocol */ + virtual ProtocolFamily getProtocolFamily(); + }; + } +} + +#endif /* OCEANBINARYPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/FPGARegisterCodes.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/FPGARegisterCodes.h new file mode 100644 index 0000000..182890d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/FPGARegisterCodes.h @@ -0,0 +1,81 @@ +/***************************************************//** + * @file FPGARegisterCodes.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_CODES_H +#define SEABREEZE_FPGA_REGISTER_CODES_H + +#include "common/features/Feature.h" +#include "common/buses/Bus.h" +#include "common/exceptions/FeatureException.h" + +namespace seabreeze { + + namespace ooiProtocol { + + namespace FPGARegisterCodes { + + /** + * These codes were taken from the USB2000+ Data Sheet as it existed + * in October 2012. They are believed to apply to the vast majority + * of Ocean Optics spectrometers, but because some variance is expected + * between models and over time (especially with custom OEM firmware), + * you should check your spectrometer's documentation before assuming + * these codes are correct for your device. + */ + class Base { + public: + static const byte FIRMWARE_VERSION; + static const byte SINGLE_STROBE_HIGH_CLOCK_TRANSITION_DELAY_COUNT; + static const byte SINGLE_STROBE_LOW_CLOCK_TRANSITION_DELAY_COUNT; + static const byte LAMP_ENABLE; + static const byte GPIO_MUX_REGISTER; + static const byte GPIO_OUTPUT_ENABLE; + static const byte GPIO_DATA_REGISTER; + static const byte OFFSET_VALUE; + static const byte OFFSET_CONTROL; + static const byte MAXIMUM_SATURATION_LEVEL; + + }; + + class V1 : public Base { + public: + static const byte CONTINUOUS_STROBE_TIMER_INTERVAL_DIVISOR; + static const byte CONTINUOUS_STROBE_BASE_CLOCK_DIVISOR; + }; + + class V3 : public Base { + public: + static const byte CONTINUOUS_STROBE_TIMER_MSB; + static const byte CONTINUOUS_STROBE_TIMER_LSB; + }; + } + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/OpCodes.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/OpCodes.h new file mode 100644 index 0000000..f35331d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/OpCodes.h @@ -0,0 +1,83 @@ +/***************************************************//** + * @file OpCodes.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OPCODES_H +#define SEABREEZE_OPCODES_H + +#include "common/SeaBreeze.h" + +namespace seabreeze { + namespace ooiProtocol { + class OpCodes { + public: + + /* Set the integration time */ + static const byte OP_ITIME; + + /* Set the strobe/lamp enable */ + static const byte OP_STROBE; + + /* Read 15 bytes from an EEPROM slot */ + static const byte OP_GETINFO; + + /* Write 15 bytes to an EEPROM slot */ + static const byte OP_SETINFO; + + /* Request a spectrum */ + static const byte OP_REQUESTSPEC; + + /* Set the trigger mode */ + static const byte OP_SETTRIGMODE; + + /* Set the thermoelectric cooling enable on the QE */ + static const byte OP_TECENABLE_QE; + + /* Read the current TEC temperature on the QE */ + static const byte OP_READTEC_QE; + + /* Set the TEC set point on the QE */ + static const byte OP_TECSETTEMP_QE; + + /* Write a field to the FPGA status register */ + static const byte OP_WRITE_REGISTER; + + /* Read a field from the FPGA status register */ + static const byte OP_READ_REGISTER; + + /* Read the irradiance calibration from EEPROM (if available) */ + static const byte OP_READ_IRRAD_CAL; + + /* Write the irradiance calibration to EEPROM (if available) */ + static const byte OP_WRITE_IRRAD_CAL; + + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/QETECConstants.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/QETECConstants.h new file mode 100644 index 0000000..1be1f3d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/constants/QETECConstants.h @@ -0,0 +1,36 @@ +/***************************************************//** + * @file QETECConstants.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_QETECCONSTANTS_H +#define SEABREEZE_QETECCONSTANTS_H + +// TEC cooler understands increments of 0.1 degrees C per encoder count. +#define QE_TEC_COUNTS_PER_DEGREE_C 10 + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterReadExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterReadExchange.h new file mode 100644 index 0000000..6c26a45 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterReadExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file FPGARegisterReadExchange.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_READ_EXCHANGE_H +#define SEABREEZE_FPGA_REGISTER_READ_EXCHANGE_H + +#include "common/protocols/Transaction.h" + +namespace seabreeze { + + class FPGARegisterReadExchange : public Transaction { + public: + FPGARegisterReadExchange(byte address); + virtual ~FPGARegisterReadExchange(); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterWriteExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterWriteExchange.h new file mode 100644 index 0000000..9cb0ddb --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGARegisterWriteExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file FPGARegisterWriteExchange.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_WRITE_EXCHANGE_H +#define SEABREEZE_FPGA_REGISTER_WRITE_EXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + + class FPGARegisterWriteExchange : public Transfer { + public: + FPGARegisterWriteExchange(byte address, unsigned short value); + virtual ~FPGARegisterWriteExchange(); + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGASpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGASpectrumExchange.h new file mode 100644 index 0000000..9baa85b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FPGASpectrumExchange.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file FPGASpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGASPECTRUMEXCHANGE_H +#define SEABREEZE_FPGASPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class FPGASpectrumExchange : public ReadSpectrumExchange { + public: + FPGASpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels); + virtual ~FPGASpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FlameNIRSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FlameNIRSpectrumExchange.h new file mode 100644 index 0000000..2471b7f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/FlameNIRSpectrumExchange.h @@ -0,0 +1,59 @@ +/***************************************************//** + * @file FlameNIRSpectrumExchange.h + * @date Apr 2016 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2016, 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_FLAMENIRSPECTRUMEXCHANGE_H +#define SEABREEZE_FLAMENIRSPECTRUMEXCHANGE_H + +#include "common/Data.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + namespace ooiProtocol { + /** + * @brief Spectrum exchange for FlameNIR spectrometer + * + * This class was needed because unlike other FX2-era spectrometers, + * the Flame-NIR does not return a "sync byte" at the end of a spectrum. + */ + class FlameNIRSpectrumExchange : public ReadSpectrumExchange { + public: + FlameNIRSpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels, GainAdjustedSpectrometerFeature *feature); + virtual ~FlameNIRSpectrumExchange(); + + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/HRFPGASpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/HRFPGASpectrumExchange.h new file mode 100644 index 0000000..e872d76 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/HRFPGASpectrumExchange.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file HRFPGASpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_HRFPGASPECTRUMEXCHANGE_H +#define SEABREEZE_HRFPGASPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class HRFPGASpectrumExchange : public ReadSpectrumExchange { + public: + HRFPGASpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels); + virtual ~HRFPGASpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/IntegrationTimeExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/IntegrationTimeExchange.h new file mode 100644 index 0000000..f388edd --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/IntegrationTimeExchange.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file IntegrationTimeExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_INTEGRATIONTIMEEXCHANGE_H +#define SEABREEZE_INTEGRATIONTIMEEXCHANGE_H + +#include "common/protocols/Transfer.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class IntegrationTimeExchange : public Transfer { + public: + IntegrationTimeExchange(unsigned long integrationTimeBase_usec); + virtual ~IntegrationTimeExchange(); + void setIntegrationTimeMicros(unsigned long integrationTime_usec); + + /* Inherited from Transfer */ + Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + unsigned long integrationTimeBase_usec; + unsigned long integrationTime_usec; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/JazSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/JazSpectrumExchange.h new file mode 100644 index 0000000..40c83ef --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/JazSpectrumExchange.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file JazSpectrumExchange.h + * @date November 2011 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_JAZSPECTRUMEXCHANGE_H +#define SEABREEZE_JAZSPECTRUMEXCHANGE_H + +#include "common/Data.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + namespace ooiProtocol { + class JazSpectrumExchange : public ReadSpectrumExchange { + public: + JazSpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels, GainAdjustedSpectrometerFeature *feature); + virtual ~JazSpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + /* This is necessary so that the saturation level which is determined + * at initialization is available to certain protocol messages. + */ + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/MayaProSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/MayaProSpectrumExchange.h new file mode 100644 index 0000000..675b77b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/MayaProSpectrumExchange.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file MayaProSpectrumExchange.h + * @date November 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_MAYAPROSPECTRUMEXCHANGE_H +#define SEABREEZE_MAYAPROSPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class MayaProSpectrumExchange : public ReadSpectrumExchange { + public: + MayaProSpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels, + GainAdjustedSpectrometerFeature *spectrometer); + virtual ~MayaProSpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + /* This is necessary so that the saturation level which is determined + * at initialization is available to certain protocol messages. + */ + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/NIRQuestSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/NIRQuestSpectrumExchange.h new file mode 100644 index 0000000..e5af731 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/NIRQuestSpectrumExchange.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file NIRQuestSpectrumExchange.h + * @date July 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_NIRQUESTSPECTRUMEXCHANGE_H +#define SEABREEZE_NIRQUESTSPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/QESpectrumExchange.h" +#include "common/Data.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + namespace ooiProtocol { + class NIRQuestSpectrumExchange : public QESpectrumExchange { + public: + NIRQuestSpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels, GainAdjustedSpectrometerFeature *feature); + virtual ~NIRQuestSpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + /* This is necessary so that the saturation level which is determined + * at initialization is available to certain protocol messages. + */ + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOI2KSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOI2KSpectrumExchange.h new file mode 100644 index 0000000..a6f3c2d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOI2KSpectrumExchange.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file OOI2KSpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is a protocol exchange that can be used for the + * HR2000 (as well as some other early OOI spectrometers). + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OOI2KSPECTRUMEXCHANGE_H +#define SEABREEZE_OOI2KSPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOI2KSpectrumExchange : public ReadSpectrumExchange { + public: + OOI2KSpectrumExchange(unsigned int readoutLength, unsigned int numberOfPixels); + virtual ~OOI2KSpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIIrradCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIIrradCalExchange.h new file mode 100644 index 0000000..971aaaa --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIIrradCalExchange.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OOIIrradCalExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OOIIRRADCALEXCHANGE_H +#define SEABREEZE_OOIIRRADCALEXCHANGE_H + +#include "common/protocols/Transaction.h" +#include "common/protocols/ProtocolHint.h" +#include + +namespace seabreeze { + namespace ooiProtocol { + class OOIIrradCalExchange : public Transaction { + public: + OOIIrradCalExchange(int numberOfPixels); + virtual ~OOIIrradCalExchange(); + + protected: + unsigned int numberOfPixels; + }; + } +} + +#endif /* SEABREEZE_OOIIRRADCALEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIReadIrradCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIReadIrradCalExchange.h new file mode 100644 index 0000000..c1898e2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIReadIrradCalExchange.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OOIReadIrradCalExchange.h + * @date March 2010 + * @author Ocean Optics, Inc. + * + * This is a protocol exchange that can be used for the + * USB2000+ and some others. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OOIREADIRRADCALEXCHANGE_H +#define SEABREEZE_OOIREADIRRADCALEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/OOIIrradCalExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOIReadIrradCalExchange : public OOIIrradCalExchange { + public: + OOIReadIrradCalExchange(int numberOfPixels); + virtual ~OOIReadIrradCalExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper* helper) throw (ProtocolException); + }; + } +} + +#endif /* SEABREEZE_OOIREADIRRADCALEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIWriteIrradCalExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIWriteIrradCalExchange.h new file mode 100644 index 0000000..e22e788 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/OOIWriteIrradCalExchange.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file OOIWriteIrradCalExchange.h + * @date February 2012 + * @author Ocean Optics, Inc. + * + * This is a protocol exchange that can be used for the + * USB2000+ and some others. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_OOIWRITEIRRADCALEXCHANGE_H +#define SEABREEZE_OOIWRITEIRRADCALEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/OOIIrradCalExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOIWriteIrradCalExchange : public OOIIrradCalExchange { + public: + OOIWriteIrradCalExchange(int numberOfPixels); + virtual ~OOIWriteIrradCalExchange(); + int setCalibration(const std::vector &calibration); + + /* Inherited */ + virtual Data *transfer(TransferHelper* helper) throw (ProtocolException); + }; + } +} + +#endif /* SEABREEZE_OOIWRITEIRRADCALEXCHANGE_H */ + diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/QESpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/QESpectrumExchange.h new file mode 100644 index 0000000..5c67535 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/QESpectrumExchange.h @@ -0,0 +1,50 @@ +/***************************************************//** + * @file QESpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_QESPECTRUMEXCHANGE_H +#define SEABREEZE_QESPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h" +#include "common/Data.h" + +namespace seabreeze { + namespace ooiProtocol { + class QESpectrumExchange : public ReadSpectrumExchange { + public: + QESpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels); + virtual ~QESpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadEEPROMSlotExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadEEPROMSlotExchange.h new file mode 100644 index 0000000..8856a18 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadEEPROMSlotExchange.h @@ -0,0 +1,46 @@ +/***************************************************//** + * @file ReadEEPROMSlotExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_READEEPROMSLOTEXCHANGE_H +#define SEABREEZE_READEEPROMSLOTEXCHANGE_H + +#include "common/protocols/Transaction.h" + +namespace seabreeze { + + class ReadEEPROMSlotExchange : public Transaction { + public: + ReadEEPROMSlotExchange(int slot); + virtual ~ReadEEPROMSlotExchange(); + + }; + +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h new file mode 100644 index 0000000..d711cf9 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadSpectrumExchange.h @@ -0,0 +1,48 @@ +/***************************************************//** + * @file ReadSpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_READSPECTRUMEXCHANGE_H +#define SEABREEZE_READSPECTRUMEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace ooiProtocol { + class ReadSpectrumExchange : public Transfer { + public: + ReadSpectrumExchange(unsigned int readoutLength, unsigned int numberOfPixels); + virtual ~ReadSpectrumExchange(); + + protected: + unsigned int numberOfPixels; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECQETemperatureExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECQETemperatureExchange.h new file mode 100644 index 0000000..b36ac61 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECQETemperatureExchange.h @@ -0,0 +1,49 @@ +/***************************************************//** + * @file ReadTECQETemperatureExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_READTECQETEMPERATUREEXCHANGE_H +#define SEABREEZE_READTECQETEMPERATUREEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadTECTemperatureExchange.h" + +namespace seabreeze { + namespace ooiProtocol { + class ReadTECQETemperatureExchange : public ReadTECTemperatureExchange { + public: + ReadTECQETemperatureExchange(); + virtual ~ReadTECQETemperatureExchange(); + + /* Inherited from Transaction */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECTemperatureExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECTemperatureExchange.h new file mode 100644 index 0000000..0d5aa72 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/ReadTECTemperatureExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file ReadTECTemperatureExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_READTECTEMPERATUREEXCHANGE_H +#define SEABREEZE_READTECTEMPERATUREEXCHANGE_H + +#include "common/protocols/Transaction.h" + +namespace seabreeze { + namespace ooiProtocol { + class ReadTECTemperatureExchange : public Transaction { + public: + ReadTECTemperatureExchange(); + virtual ~ReadTECTemperatureExchange(); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/RequestSpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/RequestSpectrumExchange.h new file mode 100644 index 0000000..c48231f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/RequestSpectrumExchange.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file RequestSpectrumExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_REQUESTSPECTRUMEXCHANGE_H +#define SEABREEZE_REQUESTSPECTRUMEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace ooiProtocol { + class RequestSpectrumExchange : public Transfer { + public: + RequestSpectrumExchange(); + virtual ~RequestSpectrumExchange(); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/StrobeEnableExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/StrobeEnableExchange.h new file mode 100644 index 0000000..1e2cc6f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/StrobeEnableExchange.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file StrobeEnableExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_STROBEENABLEEXCHANGE_H +#define SEABREEZE_STROBEENABLEEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace ooiProtocol { + class StrobeEnableExchange : public Transfer { + public: + StrobeEnableExchange(); + virtual ~StrobeEnableExchange(); + + void setEnable(bool enable); + + /* Inherited from Transfer */ + Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + bool strobeEnable; + + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECEnableExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECEnableExchange.h new file mode 100644 index 0000000..09009ae --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECEnableExchange.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file TECEnableExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is made abstract so that subclasses specific to + * the QE/NIRQuest protocol and the old legacy NIR256/512 + * can coexist. The NIR256/512 are not going to be supported + * at first, but the design will leave room for them. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TECENABLEEXCHANGE_H +#define SEABREEZE_TECENABLEEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace ooiProtocol { + class TECEnableExchange : public Transfer { + public: + TECEnableExchange(); + virtual ~TECEnableExchange(); + + virtual void setEnable(bool enable) = 0; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECQEEnableExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECQEEnableExchange.h new file mode 100644 index 0000000..1267a98 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TECQEEnableExchange.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file TECQEEnableExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is specifically for the QE-style of TEC, including + * the QE65000 and NIRQuest thermoelectric coolers. This + * will not work for the legacy NIR256/512 TEC, but a + * corresponding implementation could be derived adjacent + * to this class. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TECQEENABLEEXCHANGE_H +#define SEABREEZE_TECQEENABLEEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/TECEnableExchange.h" + +namespace seabreeze { + namespace ooiProtocol { + class TECQEEnableExchange : public TECEnableExchange { + public: + TECQEEnableExchange(); + virtual ~TECQEEnableExchange(); + + /* Inherited from TECEnableExchange */ + virtual void setEnable(bool enable); + Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + bool tecEnable; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TriggerModeExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TriggerModeExchange.h new file mode 100644 index 0000000..00de06b --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/TriggerModeExchange.h @@ -0,0 +1,54 @@ +/***************************************************//** + * @file TriggerModeExchange.h + * @date August 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_TRIGGERMODEEXCHANGE_H +#define SEABREEZE_TRIGGERMODEEXCHANGE_H + +#include "common/protocols/Transfer.h" +#include "common/Data.h" +#include "vendors/OceanOptics/features/spectrometer/SpectrometerTriggerMode.h" + +namespace seabreeze { + namespace ooiProtocol { + class TriggerModeExchange : public Transfer { + public: + TriggerModeExchange(); + virtual ~TriggerModeExchange(); + void setTriggerMode(SpectrometerTriggerMode &mode); + + /* Inherited from Transfer */ + Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + int triggerMode; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/USBFPGASpectrumExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/USBFPGASpectrumExchange.h new file mode 100644 index 0000000..ffb9b11 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/USBFPGASpectrumExchange.h @@ -0,0 +1,57 @@ +/***************************************************//** + * @file USBFPGASpectrumExchange.h + * @date July 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_USBFPGASPECTRUMEXCHANGE_H +#define SEABREEZE_USBFPGASPECTRUMEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/FPGASpectrumExchange.h" +#include "common/Data.h" +#include "vendors/OceanOptics/features/spectrometer/GainAdjustedSpectrometerFeature.h" + +namespace seabreeze { + namespace ooiProtocol { + class USBFPGASpectrumExchange : public FPGASpectrumExchange { + public: + USBFPGASpectrumExchange(unsigned int readoutLength, + unsigned int numberOfPixels, GainAdjustedSpectrometerFeature *feature); + virtual ~USBFPGASpectrumExchange(); + + /* Inherited */ + virtual Data *transfer(TransferHelper *helper) throw (ProtocolException); + + protected: + /* This is necessary so that the saturation level which is determined + * at initialization is available to certain protocol messages. + */ + GainAdjustedSpectrometerFeature *spectrometerFeature; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteEEPROMSlotExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteEEPROMSlotExchange.h new file mode 100644 index 0000000..3c9d3a8 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteEEPROMSlotExchange.h @@ -0,0 +1,43 @@ +/***************************************************//** + * @file WriteEEPROMSlotExchange.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_WRITE_EEPROM_SLOT_EXCHANGE_H +#define SEABREEZE_WRITE_EEPROM_SLOT_EXCHANGE_H + +#include "common/protocols/Transaction.h" + +namespace seabreeze { + class WriteEEPROMSlotExchange : public Transaction { + public: + WriteEEPROMSlotExchange(int slot, const std::vector& data); + virtual ~WriteEEPROMSlotExchange(); + }; +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECQESetPointExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECQESetPointExchange.h new file mode 100644 index 0000000..4670365 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECQESetPointExchange.h @@ -0,0 +1,58 @@ +/***************************************************//** + * @file WriteTECQESetPointExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is made abstract so that subclasses specific to + * the QE/NIRQuest protocol and the old legacy NIR256/512 + * can coexist. The NIR256/512 are not going to be supported + * at first, but the design will leave room for them. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_WRITETECQESETPOINTEXCHANGE_H +#define SEABREEZE_WRITETECQESETPOINTEXCHANGE_H + +#include "vendors/OceanOptics/protocols/ooi/exchanges/WriteTECSetPointExchange.h" + +namespace seabreeze { + namespace ooiProtocol { + class WriteTECQESetPointExchange : public WriteTECSetPointExchange { + public: + WriteTECQESetPointExchange(); + virtual ~WriteTECQESetPointExchange(); + + /** Inherited from WriteTECSetPointExchange */ + virtual void setSetPointCelsius(double degreesC); + Data *transfer(TransferHelper *helper) throw (ProtocolException); + + private: + int tecCounts; + + }; + } +} + +#endif /* OOIPROTOCOLWRITETECQESETPOINTEXCHANGE_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECSetPointExchange.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECSetPointExchange.h new file mode 100644 index 0000000..82e077f --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/exchanges/WriteTECSetPointExchange.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file WriteTECSetPointExchange.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This is made abstract so that subclasses specific to + * the QE/NIRQuest protocol and the old legacy NIR256/512 + * can coexist. The NIR256/512 are not going to be supported + * at first, but the design will leave room for them. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_WRITETECSETPOINTEXCHANGE_H +#define SEABREEZE_WRITETECSETPOINTEXCHANGE_H + +#include "common/protocols/Transfer.h" + +namespace seabreeze { + namespace ooiProtocol { + class WriteTECSetPointExchange : public Transfer { + public: + WriteTECSetPointExchange(); + virtual ~WriteTECSetPointExchange(); + + virtual void setSetPointCelsius(double degreesC) = 0; + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/ControlHint.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/ControlHint.h new file mode 100644 index 0000000..0123724 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/ControlHint.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file ControlHint.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_CONTROLHINT_H +#define SEABREEZE_CONTROLHINT_H + +#include "common/protocols/ProtocolHint.h" + +namespace seabreeze { + namespace ooiProtocol { + class ControlHint : public ProtocolHint { + public: + ControlHint(); + virtual ~ControlHint(); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/SpectrumHint.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/SpectrumHint.h new file mode 100644 index 0000000..f24c4f5 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/hints/SpectrumHint.h @@ -0,0 +1,45 @@ +/***************************************************//** + * @file SpectrumHint.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_SPECTRUMHINT_H +#define SEABREEZE_SPECTRUMHINT_H + +#include "common/protocols/ProtocolHint.h" + +namespace seabreeze { + namespace ooiProtocol { + class SpectrumHint : public ProtocolHint { + public: + SpectrumHint(); + virtual ~SpectrumHint(); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/FPGARegisterProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/FPGARegisterProtocol.h new file mode 100644 index 0000000..8f9a667 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/FPGARegisterProtocol.h @@ -0,0 +1,52 @@ +/***************************************************//** + * @file FPGARegisterProtocol.h + * @date October 2012 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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_FPGA_REGISTER_PROTOCOL_H +#define SEABREEZE_FPGA_REGISTER_PROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "vendors/OceanOptics/protocols/interfaces/FPGARegisterProtocolInterface.h" + +namespace seabreeze { + namespace ooiProtocol { + class FPGARegisterProtocol : public FPGARegisterProtocolInterface { + public: + FPGARegisterProtocol(); + virtual ~FPGARegisterProtocol(); + virtual unsigned int readRegister(const Bus &bus, byte address) + throw (ProtocolException); + virtual void writeRegister(const Bus &bus, byte address, + unsigned int value) throw (ProtocolException); + }; + } +} + +#endif diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIEEPROMProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIEEPROMProtocol.h new file mode 100644 index 0000000..a409a1d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIEEPROMProtocol.h @@ -0,0 +1,53 @@ +/***************************************************//** + * @file OOIEEPROMProtocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIEEPROMPROTOCOL_H +#define OOIEEPROMPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/buses/Bus.h" +#include "common/exceptions/ProtocolException.h" +#include "vendors/OceanOptics/protocols/interfaces/EEPROMProtocolInterface.h" +#include + +namespace seabreeze { + namespace ooiProtocol { + class OOIEEPROMProtocol : public EEPROMProtocolInterface { + public: + OOIEEPROMProtocol(); + virtual ~OOIEEPROMProtocol(); + virtual std::vector *readEEPROMSlot(const Bus &bus, int slot) + throw (ProtocolException); + virtual int writeEEPROMSlot(const Bus &bus, int slot, + const std::vector &data) throw (ProtocolException); + }; + } +} + +#endif /* OOIEEPROMPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIIrradCalProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIIrradCalProtocol.h new file mode 100644 index 0000000..012abb2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIIrradCalProtocol.h @@ -0,0 +1,63 @@ +/***************************************************//** + * @file OOIIrradCalProtocol.h + * @date March 2010 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIIRRADCALPROTOCOL_H +#define OOIIRRADCALPROTOCOL_H + +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/IrradCalProtocolInterface.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/OOIReadIrradCalExchange.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/OOIWriteIrradCalExchange.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOIIrradCalProtocol : public IrradCalProtocolInterface { + public: + OOIIrradCalProtocol(unsigned int numberOfPixels); + virtual ~OOIIrradCalProtocol(); + + /* Inherited from IrradCalProtocolInterface */ + virtual std::vector *readIrradCal(const Bus &bus) + throw (ProtocolException); + virtual int writeIrradCal(const Bus &bus, const std::vector &cal) + throw (ProtocolException); + virtual int hasCollectionArea(const Bus &bus); + virtual float readCollectionArea(const Bus &bus) + throw (ProtocolException); + virtual void writeCollectionArea(const Bus &bus, float area) + throw (ProtocolException); + + private: + unsigned int numberOfPixels; + }; + } +} + +#endif /* OOIIRRADCALPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIProtocol.h new file mode 100644 index 0000000..cac8845 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIProtocol.h @@ -0,0 +1,51 @@ +/***************************************************//** + * @file OOIProtocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * This provides a singleton object that identifies the + * OOI legacy USB command set. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOIPROTOCOL_H +#define OOIPROTOCOL_H + +#include "common/protocols/Protocol.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOIProtocol : public Protocol { + public: + OOIProtocol(); + virtual ~OOIProtocol(); + + /* Must be overridden from Protocol */ + virtual ProtocolFamily getProtocolFamily(); + }; + } +} + +#endif /* OOIPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOISpectrometerProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOISpectrometerProtocol.h new file mode 100644 index 0000000..5b2a30d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOISpectrometerProtocol.h @@ -0,0 +1,79 @@ +/***************************************************//** + * @file OOISpectrometerProtocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOISPECTROMETERPROTOCOL_H +#define OOISPECTROMETERPROTOCOL_H + +#include "common/SeaBreeze.h" +#include "common/protocols/Exchange.h" +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/IntegrationTimeExchange.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/TriggerModeExchange.h" +#include "vendors/OceanOptics/protocols/interfaces/SpectrometerProtocolInterface.h" +#include + +namespace seabreeze { + namespace ooiProtocol { + class OOISpectrometerProtocol : public SpectrometerProtocolInterface { + public: + OOISpectrometerProtocol( + IntegrationTimeExchange *integrationTimeExchange, + Transfer *requestSpectrumExchange, + Transfer *unformattedSpectrumExchange, + Transfer *spectrumTransferExchange, + TriggerModeExchange *triggerMode); + virtual ~OOISpectrometerProtocol(); + + /* FIXME: instead of returning primitive vectors, should this return Data* so that + * metadata (units, etc.) can also be attached? + */ + virtual std::vector *readUnformattedSpectrum(const Bus &bus) + throw (ProtocolException); + virtual std::vector *readSpectrum(const Bus &bus) + throw (ProtocolException); + virtual void requestSpectrum(const Bus &bus) throw (ProtocolException); + virtual void setIntegrationTimeMicros(const Bus &bus, + unsigned long time_usec) throw (ProtocolException); + virtual void setTriggerMode(const Bus &bus, + SpectrometerTriggerMode &mode) throw (ProtocolException); + + private: + IntegrationTimeExchange *integrationTimeExchange; + /* These are Transfers instead of Exchanges so that we can call getHints() on them. + * if getHints is promoted up to the level of Exchange, then these can revert back. + */ + Transfer *unformattedSpectrumExchange; + Transfer *requestSpectrumExchange; + Transfer *spectrumTransferExchange; + TriggerModeExchange *triggerModeExchange; + }; + } +} + +#endif /* OOISPECTROMETERPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIStrobeLampProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIStrobeLampProtocol.h new file mode 100644 index 0000000..edf1df2 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOIStrobeLampProtocol.h @@ -0,0 +1,55 @@ +/***************************************************//** + * @file OOIStrobeLampProtocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOISTROBELAMPPROTOCOL_H +#define OOISTROBELAMPPROTOCOL_H + +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/StrobeEnableExchange.h" +#include "vendors/OceanOptics/protocols/interfaces/StrobeLampProtocolInterface.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOIStrobeLampProtocol : public StrobeLampProtocolInterface { + public: + OOIStrobeLampProtocol(); + virtual ~OOIStrobeLampProtocol(); + + virtual void setStrobeLampEnable(const Bus &bus, bool enable) + throw (ProtocolException); + + private: + StrobeEnableExchange *strobeEnableExchange; + + }; + } +} + +#endif /* OOISTROBELAMPPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOITECProtocol.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOITECProtocol.h new file mode 100644 index 0000000..89e930d --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/protocols/ooi/impls/OOITECProtocol.h @@ -0,0 +1,65 @@ +/***************************************************//** + * @file OOITECProtocol.h + * @date February 2009 + * @author Ocean Optics, Inc. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 OOITECPROTOCOL_H +#define OOITECPROTOCOL_H + +#include "common/buses/Bus.h" +#include "vendors/OceanOptics/protocols/interfaces/ThermoElectricProtocolInterface.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/TECEnableExchange.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/WriteTECSetPointExchange.h" +#include "vendors/OceanOptics/protocols/ooi/exchanges/ReadTECTemperatureExchange.h" +#include "common/exceptions/ProtocolException.h" + +namespace seabreeze { + namespace ooiProtocol { + class OOITECProtocol : public ThermoElectricProtocolInterface { + public: + OOITECProtocol(TECEnableExchange *enableExchange, + WriteTECSetPointExchange *writeSetPointExchange, + ReadTECTemperatureExchange *readTECTempExchange); + virtual ~OOITECProtocol(); + + /* Inherited from ThermoElectricProtocolInterface */ + virtual double readThermoElectricTemperatureCelsius(const Bus &bus) + throw (ProtocolException); + virtual void writeThermoElectricEnable(const Bus &bus, bool enable) + throw (ProtocolException); + virtual void writeThermoElectricSetPointCelsius(const Bus &bus, double degreesC) + throw (ProtocolException); + + private: + TECEnableExchange *tecEnable; + WriteTECSetPointExchange *tecWriteSetPoint; + ReadTECTemperatureExchange *tecReadTemperature; + }; + } +} + +#endif /* OOITECPROTOCOL_H */ diff --git a/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/utils/Polynomial.h b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/utils/Polynomial.h new file mode 100644 index 0000000..5d1ff15 --- /dev/null +++ b/othersoft/shuttercali/source/OSIF/include/vendors/OceanOptics/utils/Polynomial.h @@ -0,0 +1,111 @@ +/***************************************************//** + * @file Polynomial.h + * @date February 2011 + * @author Ocean Optics, Inc. + * + * The template type for this class must be either + * double or float. Any other type may cause unexpected + * results or a failure to compile. + * + * The implementation for this class is also contained + * in the header file so that it is compiled consistently + * when needed. Otherwise, there could be linker + * issues. + * + * LICENSE: + * + * SeaBreeze Copyright (C) 2014, 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 POLYNOMIAL_H +#define POLYNOMIAL_H + +#include + +namespace seabreeze { + template + class Polynomial { + public: + Polynomial(std::vector *coefficients); + Polynomial(T *coefficients, unsigned int length); + ~Polynomial(); + T evaluate(T x); + private: + std::vector *coefficients; + }; + + template + Polynomial::Polynomial(std::vector *coeffs) { + unsigned int i; + + if(NULL == coeffs) { + this->coefficients = new std::vector(0); + } else { + this->coefficients = new std::vector(coeffs->size()); + } + for(i = 0; i < coeffs->size(); i++) { + (*(this->coefficients))[i] = (*coeffs)[i]; + } + } + + template + Polynomial::Polynomial(T *coeffs, unsigned int length) { + unsigned int i; + + if(NULL == coeffs) { + this->coefficients = new std::vector(0); + } else { + this->coefficients = new std::vector(length); + } + for(i = 0; i < length; i++) { + (*(this->coefficients))[i] = coeffs[i]; + } + } + + + template + Polynomial::~Polynomial() { + delete this->coefficients; + } + + + template + T Polynomial::evaluate(T x) { + T acc; + T retval = 0.0; + unsigned int order; + + if(NULL == this->coefficients || 0 == this->coefficients->size()) { + return 0; + } + + retval = this->coefficients->at(0); /* Initialize to A */ + acc = 1; + for(order = 1; order < this->coefficients->size(); order++) { + acc *= x; + retval += this->coefficients->at(order) * acc; /* Add x^n term (Bx^2, Cx^3, ...) */ + } + return retval; + } + +} + +#endif /* POLYNOMIAL_H */ diff --git a/othersoft/shuttercali/source/Settings/SystemConfigger.cpp b/othersoft/shuttercali/source/Settings/SystemConfigger.cpp new file mode 100644 index 0000000..46e8800 --- /dev/null +++ b/othersoft/shuttercali/source/Settings/SystemConfigger.cpp @@ -0,0 +1,191 @@ +#include "SystemConfigger.h" + + + ZZ_SysConfigger::ZZ_SysConfigger(QObject *parent /*= nullptr*/) + { +#ifdef _DEBUG + m_qstrDeviceConfigFilePath = "E:/WorkSpace/TowerOptoSifAndSpectral/config/DeviceSettings.ini"; + m_qstrJSONConfigFilePath = "E:/WorkSpace/TowerOptoSifAndSpectral/config/config.json"; +#else + m_qstrJSONConfigFilePath = ("/home/data/Setting/config.json"); +#endif // DEBUG + + m_qsDeviceConfig = NULL; + } + + ZZ_SysConfigger::~ZZ_SysConfigger() + { + if (qfJConfig.isOpen()) + { + qfJConfig.close(); + } + } + + int ZZ_SysConfigger::Initialize() + { + //////////////////////////////////////////////////////////////////////////load device settings + using namespace ZZ_MISCDEF; + QMetaEnum enumDeviceModel = QMetaEnum::fromType(); + + if (m_qsDeviceConfig!=NULL) + { + delete m_qsDeviceConfig; + } + m_qsDeviceConfig = new QSettings(m_qstrDeviceConfigFilePath, QSettings::IniFormat); + m_struDeviceContext.ucDeviceNumber = m_qsDeviceConfig->value(QString("DEVICE INFO/TotalSpectrometer"),-1).toInt(); + if (m_struDeviceContext.ucDeviceNumber == -1) + { + qDebug() << "DEVICE INFO TotalSpectrometer Value Err."; + return 3; + } + for (ZZ_U8 i=0;i< m_struDeviceContext.ucDeviceNumber;i++) + { + QString qstrTemp= m_qsDeviceConfig->value(QString("FS%1/Model").arg(i+1), "Null").toString(); + m_struDeviceContext.ucDeviceModel[i]= enumDeviceModel.keysToValue(qstrTemp.toLatin1().data()); + + int iInterface= m_qsDeviceConfig->value(QString("FS%1/Port").arg(i + 1), -2).toInt(); + m_struDeviceContext.iInterface[i] = iInterface; + + qstrTemp = m_qsDeviceConfig->value(QString("FS%1/UID").arg(i + 1), "Null").toString(); + m_struDeviceContext.strSN[i] = qstrTemp.toStdString(); + } + + m_struAcqPosition.iTotalPosition = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/TotalPosition"), -1).toInt(); + if (m_struAcqPosition.iTotalPosition == -1) + { + qDebug() << "LINEAR SHUTTER TotalPosition Value Err."; + return 4; + } + + for (ZZ_U8 i = 0; i < m_struAcqPosition.iTotalPosition; i++) + { + int iPosition = m_qsDeviceConfig->value(QString("LINEAR SHUTTER/Position%1").arg(i), -2).toInt(); + m_struAcqPosition.iPosition[i] = iPosition; + } + + + + //////////////////////////////////////////////////////////////////////////load json settings + qfJConfig.setFileName(m_qstrJSONConfigFilePath); + bool bRes = qfJConfig.open(QIODevice::ReadOnly); + if (!bRes) + { + qDebug() << "QFile open config file Err."; + return 1; + } + + m_qbaJData = qfJConfig.readAll(); + m_qjdJDoc= QJsonDocument::fromJson(m_qbaJData, &m_qjpeJErr); + if (m_qjpeJErr.error != QJsonParseError::NoError) + { + qDebug() << m_qjpeJErr.errorString(); + return 2; + } + m_qjoJObj = m_qjdJDoc.object(); + return 0; + } + + int ZZ_SysConfigger::GetGrabberRunParams(RunTimeGrabberParams &struGrabberRTParams) + { + struGrabberRTParams.atsParams = m_struAcqTime; + struGrabberRTParams.fscParams = m_struDeviceContext; + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_IS1() + { + m_struIS1Info.qstrCalFile_U0 = m_qjoJObj.value("IS1UpCalFile").toString(); + m_struIS1Info.qstrCalFile_D1 = m_qjoJObj.value("IS1DownCalFile1").toString(); + m_struIS1Info.qstrCalFile_D2 = m_qjoJObj.value("IS1DownCalFile2").toString(); + m_struIS1Info.qstrCalFile_D3 = m_qjoJObj.value("IS1DownCalFile3").toString(); + + + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_iSIF() + { + m_struISIFInfo.qstrCalFile_U0 = m_qjoJObj.value("SIFUpCalFile").toString(); + m_struISIFInfo.qstrCalFile_D1 = m_qjoJObj.value("SIFDownCalFile1").toString(); + m_struISIFInfo.qstrCalFile_D2 = m_qjoJObj.value("SIFDownCalFile2").toString(); + m_struISIFInfo.qstrCalFile_D3 = m_qjoJObj.value("SIFDownCalFile3").toString(); + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_System() + { + // QString qstr = m_qjoJObj.value("IntervalTime").toString(); + m_struAcqTime.qtStartTime=QTime::fromString(m_qjoJObj.value("BeginTime").toString(), "hh:mm"); + if (!m_struAcqTime.qtStartTime.isValid()) + { + qDebug() << "Invalid BeginTime"; + return 1; + } + +#ifdef _DEBUG + m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "ss"); + if (!m_struAcqTime.qtInterval.isValid()) + { + qDebug() << "Invalid IntervalTime"; + return 1; + } +#else + m_struAcqTime.qtInterval = QTime::fromString(m_qjoJObj.value("IntervalTime").toString(), "mm"); + if (!m_struAcqTime.qtInterval.isValid()) + { + qDebug() << "Invalid IntervalTime"; + return 1; + } +#endif + + m_struAcqTime.qtStopTime = QTime::fromString(m_qjoJObj.value("EndTime").toString(), "hh:mm"); + if (!m_struAcqTime.qtStopTime.isValid()) + { + qDebug() << "Invalid EndTime"; + return 1; + } + + return 0; + } + + int ZZ_SysConfigger::LoadSettingsFromFile_MISC() + { + m_struEC.qstrLocation = m_qjoJObj.value("Location").toString(); + m_struEC.qstrGPS_Altitude = m_qjoJObj.value("GPS_Altitude").toString(); + m_struEC.qstrGPS_Latitude = m_qjoJObj.value("GPS_Latitude").toString(); + m_struEC.qstrGPS_Longtitude = m_qjoJObj.value("GPS_Longtitude").toString(); + m_struEC.qstrGPS_North = m_qjoJObj.value("GPS_North").toString(); + + m_struMEC.qstrInstallationTime = m_qjoJObj.value("InstallationTime").toString(); + m_struMEC.qstrISIFCalibrationTime = m_qjoJObj.value("ISIFCalibrationTime").toString(); + m_struMEC.qstrIS1CalibrationTime = m_qjoJObj.value("IS1CalibrationTime").toString(); + m_struMEC.qstrNameOfMaintenanceStaff = m_qjoJObj.value("NameOfMaintenanceStaff").toString(); + m_struMEC.qstrPhoneNumberOfMaintenanceStaff = m_qjoJObj.value("PhoneNumberOfMaintenanceStaff").toString(); + m_struMEC.qstrDownloadUserID = m_qjoJObj.value("DownloadUserID").toString(); + m_struMEC.qstrDownlaodAddress = m_qjoJObj.value("DownlaodAddress").toString(); + + + + return 0; + } + + int ZZ_SysConfigger::LoadSettings_Test() + { + QFile qfTest(m_qstrJSONConfigFilePath); + + qfTest.open(QFile::ReadOnly); + + QByteArray qbJData = qfTest.readAll(); + + QJsonParseError jerr; + QJsonDocument jdoc(QJsonDocument::fromJson(qbJData, &jerr)); + if (jerr.error!= QJsonParseError::NoError) + { + qDebug() << jerr.errorString(); + } + + QJsonObject rootobj = jdoc.object(); + QStringList key = rootobj.keys(); + QString qtest1 = rootobj.value(rootobj.keys().at(15)).toString(); + return 0; + } diff --git a/othersoft/shuttercali/source/Settings/SystemConfigger.h b/othersoft/shuttercali/source/Settings/SystemConfigger.h new file mode 100644 index 0000000..6f237a2 --- /dev/null +++ b/othersoft/shuttercali/source/Settings/SystemConfigger.h @@ -0,0 +1,57 @@ +#pragma once +#include "pch.h" +#include "ZZ_Types.h" +using namespace ZZ_MISCDEF::ZZ_RUNPARAMS; +using namespace ZZ_MISCDEF::ZZ_DATAFILE; + +class ZZ_SysConfigger :public QObject +{ + Q_OBJECT + +public: + ZZ_SysConfigger(QObject *parent = nullptr); + virtual ~ZZ_SysConfigger(); +public: + int Initialize(); + int GetGrabberRunParams(RunTimeGrabberParams &struGrabberRTParams); + + int LoadSettingsFromFile_IS1(); + int LoadSettingsFromFile_iSIF(); + int LoadSettingsFromFile_System(); + int LoadSettingsFromFile_MISC(); + int LoadSettings_Test(); +public: + enum ConfiggerDeviceModel + { + OSIFAlpha = 0, + OSIFBeta, + ISIF, + IS1, + IS2, + Null + }; + Q_ENUM(ConfiggerDeviceModel); + //////////////////////////////////////////////////////////////////////////run-time settings + AcqTimeSettings m_struAcqTime; + FSContext m_struDeviceContext; + AcqPosSettings m_struAcqPosition; + ////////////////////////////////////////////////////////////////////////// + EContext m_struEC; + MEContext m_struMEC; + IS1Info m_struIS1Info; + ISIFInfo m_struISIFInfo; + +private: + QString m_qstrDeviceConfigFilePath; + QString m_qstrJSONConfigFilePath; + QFile qfJConfig/*,qfDeviceConfig*/; + QSettings *m_qsDeviceConfig; + + QByteArray m_qbaJData; + QJsonParseError m_qjpeJErr; + QJsonObject m_qjoJObj; + QJsonDocument m_qjdJDoc; + + + +}; \ No newline at end of file diff --git a/othersoft/shuttercali/source/Thread/AbstractFSController.cpp b/othersoft/shuttercali/source/Thread/AbstractFSController.cpp new file mode 100644 index 0000000..8aebeed --- /dev/null +++ b/othersoft/shuttercali/source/Thread/AbstractFSController.cpp @@ -0,0 +1,74 @@ +#include "AbstractFSController.h" +CAbstractFSController::CAbstractFSController(QObject* parent /*= nullptr*/) +{ + m_pFSCtrl = NULL; + m_iThreadID = -1; +} + +CAbstractFSController::~CAbstractFSController() +{ + if (m_pFSCtrl!= 0 ) + { + delete m_pFSCtrl; + } +} + +int CAbstractFSController::SetRunParas(int iThreadID, FSInfo fsInfo) +{ + m_iThreadID = iThreadID; + m_fsInfo = fsInfo; + return 0; +} + + + +int CAbstractFSController::InitializeFSControl() +{ + using namespace ZZ_MISCDEF::IRIS; + if (m_iThreadID == -1/*|| m_iDeviceType == -1*/) + { + qDebug() << "Params Err. Call SetRunParas first"; + return 1; + } + switch (m_fsInfo.ucDeviceModel) + { + case DeviceModel::OSIFAlpha: + + break; + case DeviceModel::OSIFBeta: + break; + case DeviceModel::ISIF: + m_pFSCtrl = new ZZ_ATPControl_Serial_Qt; + m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL); + break; + case DeviceModel::IS1: + m_pFSCtrl = new ZZ_ATPControl_Serial_Qt; + m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL); + break; + case DeviceModel::IS2: + m_pFSCtrl = new ZZ_ATPControl_Serial_Qt; + m_pFSCtrl->Initialize(false, m_fsInfo.iInterface, NULL); + break; + default: + break; + } + return 0; +} + +int CAbstractFSController::StartAcquisition() +{ + // + qDebug() << "Starting acq" << " Thread ID:" << m_iThreadID; + QThread::msleep(5000); + qDebug() << "Stop acq" << " Thread ID:" << m_iThreadID; + emit SignalAcqFinished(m_iThreadID, 1); + return 0; +} + +int CAbstractFSController::StopAcquisition() +{ + + return 0; +} + + diff --git a/othersoft/shuttercali/source/Thread/AbstractFSController.h b/othersoft/shuttercali/source/Thread/AbstractFSController.h new file mode 100644 index 0000000..0788356 --- /dev/null +++ b/othersoft/shuttercali/source/Thread/AbstractFSController.h @@ -0,0 +1,38 @@ +#pragma once +#include "pch.h" +#include "ATPControl_Serial_QT.h" +#include + +typedef struct tagFSInfo +{ + ZZ_U8 ucDeviceModel; + int iInterface; + std::string strSN; +}FSInfo; + +class CAbstractFSController :public QObject +{ + Q_OBJECT +public: + CAbstractFSController(QObject* parent = nullptr); + virtual ~CAbstractFSController(); +public: + //call first + virtual int SetRunParas(int iThreadID, FSInfo fsInfo); + + //create derived class from base class + virtual int InitializeFSControl(); + +private: + CIrisFSBase *m_pFSCtrl; + int m_iThreadID; + FSInfo m_fsInfo; + +public slots: + virtual int StartAcquisition(); + virtual int StopAcquisition(); + +signals: + void SignalAcqStarted(); + void SignalAcqFinished(int iThreadID, int iFlagStatus); +}; \ No newline at end of file diff --git a/othersoft/shuttercali/source/Thread/MainDataGrabber.cpp b/othersoft/shuttercali/source/Thread/MainDataGrabber.cpp new file mode 100644 index 0000000..21e77ee --- /dev/null +++ b/othersoft/shuttercali/source/Thread/MainDataGrabber.cpp @@ -0,0 +1,140 @@ +#include "MainDataGrabber.h" + +CMainDataGrabber::CMainDataGrabber(QObject* parent /*= nullptr*/) +{ + m_piFlagCaptureThreadStatus = NULL; +} + +CMainDataGrabber::~CMainDataGrabber() +{ + if (m_pControlThread.size() != 0) + { + for (int i=0;i< m_pControlThread.size();i++) + { + delete m_pControlThread[i]; + } + } + m_pControlThread.clear(); + + if (m_piFlagCaptureThreadStatus!=NULL) + { + delete m_piFlagCaptureThreadStatus; + } +} + +int CMainDataGrabber::SetGrabberParams(RunTimeGrabberParams struGrabberRTParams) +{ + m_struAcqTime = struGrabberRTParams.atsParams; + m_struDeviceContext = struGrabberRTParams.fscParams; + m_iTotalThreads = m_struDeviceContext.ucDeviceNumber; + return 0; +} + +int CMainDataGrabber::InitThreadStatus() +{ + if (m_piFlagCaptureThreadStatus!=NULL) + { + delete m_piFlagCaptureThreadStatus; + } + m_piFlagCaptureThreadStatus = new int[m_iTotalThreads]; + for (int i = 0; i < m_iTotalThreads; i++) + { + m_piFlagCaptureThreadStatus[i] = 0; + } + return 0; +} + +int CMainDataGrabber::InitializeWorkers() +{ + for (ZZ_U8 i = 0; i < m_struDeviceContext.ucDeviceNumber; i++) + { + m_piFlagCaptureThreadStatus[i] = 0; + + FSInfo fsInfo; + fsInfo.iInterface = m_struDeviceContext.iInterface[i]; + fsInfo.ucDeviceModel = m_struDeviceContext.ucDeviceModel[i]; + fsInfo.strSN = m_struDeviceContext.strSN[i]; + + CAbstractFSController* m_pWorkThread = new CAbstractFSController; + m_pWorkThread->SetRunParas(i, fsInfo); + //m_pWorkThread->InitializeFSControl(); + m_pControlThread.push_back(m_pWorkThread); + } + return 0; +} + +int CMainDataGrabber::StartWorkers() +{ + + for (ZZ_U8 i = 0; i < m_struDeviceContext.ucDeviceNumber; i++) + { + QThread *pWorkThreadHolder = new QThread(); + m_pControlThread[i]->moveToThread(pWorkThreadHolder); + pWorkThreadHolder->start(); + } + + return 0; +} + +int CMainDataGrabber::SetupMsgPipelines() +{ + //connect(this, &CMainDataGrabber::SignalStartGrabOnce, this, &CMainDataGrabber::StartGrab); + + for (ZZ_U8 i = 0; i < m_struDeviceContext.ucDeviceNumber; i++) + { + connect(this, &CMainDataGrabber::SignalStartGrabOnce, m_pControlThread[i], &CAbstractFSController::StartAcquisition); + connect(m_pControlThread[i], &CAbstractFSController::SignalAcqFinished, this, &CMainDataGrabber::HandleThreadEvent); + } + + connect(this, &CMainDataGrabber::SignalGrabOnceFinished, this, &CMainDataGrabber::GrabFinished); + + return 0; +} + +int CMainDataGrabber::HandleThreadEvent(int iThreadID, int iFlagStatus) +{ + m_piFlagCaptureThreadStatus[iThreadID] = iFlagStatus; + + bool bFinished = true; + for (int i = 0; i < m_iTotalThreads; i++) + { + if (m_piFlagCaptureThreadStatus[i] != 1) + { + bFinished = false; + break; + } + } + + if (bFinished) + { + emit SignalGrabOnceFinished(); + } + return 0; +} + +int CMainDataGrabber::StartGrab() +{ + m_iFlagIsCapturing = true; + emit SignalStartGrabOnce(); + while (m_iFlagIsCapturing) + { + QThread::msleep(1000); + } + + m_iFlagIsCapturing = true; + InitThreadStatus(); + emit SignalStartGrabOnce(); + while (m_iFlagIsCapturing) + { + QThread::msleep(1000); + } + qDebug() << "Allgrab stopped" << " Thread ID:" <<2; + return 0; +} + +int CMainDataGrabber::GrabFinished() +{ + m_iFlagIsCapturing = false; + return 0; +} + diff --git a/othersoft/shuttercali/source/Thread/MainDataGrabber.h b/othersoft/shuttercali/source/Thread/MainDataGrabber.h new file mode 100644 index 0000000..3d3abb2 --- /dev/null +++ b/othersoft/shuttercali/source/Thread/MainDataGrabber.h @@ -0,0 +1,48 @@ +#pragma once +#include"pch.h" +#include +#include "AbstractFSController.h" + +using namespace std; +using namespace ZZ_MISCDEF::ZZ_RUNPARAMS; + +class CMainDataGrabber :public QObject +{ + Q_OBJECT +public: + CMainDataGrabber(QObject* parent = nullptr); + ~CMainDataGrabber(); + +private: + vector m_pControlThread; + vector m_pqThreadHolder; + + int *m_piFlagCaptureThreadStatus; + int m_iTotalThreads; + + int m_iFlagIsCapturing; + + AcqTimeSettings m_struAcqTime; + FSContext m_struDeviceContext; + +public: + //Call this first + int SetGrabberParams(RunTimeGrabberParams struGrabberRTParams); + + int InitThreadStatus(); + int InitializeWorkers(); + int StartWorkers(); + + int SetupMsgPipelines(); + +public slots: + int HandleThreadEvent(int iThreadID, int iFlagStatus); + int StartGrab(); + int GrabFinished(); + +signals: + void SignalStartGrabOnce(); + void SignalStopGrab(); + void SignalGrabOnceFinished(); + void SignalStartGrab(); +}; \ No newline at end of file diff --git a/othersoft/shuttercali/source/ZZ_SDK/ZZ_Math_HDRONLY.h b/othersoft/shuttercali/source/ZZ_SDK/ZZ_Math_HDRONLY.h new file mode 100644 index 0000000..d57693b --- /dev/null +++ b/othersoft/shuttercali/source/ZZ_SDK/ZZ_Math_HDRONLY.h @@ -0,0 +1,84 @@ +#pragma once +namespace ZZ_MATH +{ + + template + void MinHeapify(T*arry, int size, int element) + { + int lchild = element * 2 + 1, rchild = lchild + 1; + while (rchild < size) + { + if (arry[element] <= arry[lchild] && arry[element] <= arry[rchild]) + { + return; + } + if (arry[lchild] <= arry[rchild]) + { + std::swap(arry[element], arry[lchild]); + element = lchild; + } + else + { + std::swap(arry[element], arry[rchild]); + element = rchild; + } + lchild = element * 2 + 1; + rchild = lchild + 1; + } + if (lchild < size&&arry[lchild] < arry[element]) + { + std::swap(arry[lchild], arry[element]); + } + return; + } + + template + void MaxHeapify(T*arry, int size, int element) + { + int lchild = element * 2 + 1, rchild = lchild + 1; + while (rchild < size) + { + if (arry[element] >= arry[lchild] && arry[element] >= arry[rchild]) + { + return; + } + if (arry[lchild] >= arry[rchild]) + { + std::swap(arry[element], arry[lchild]); + element = lchild; + } + else + { + std::swap(arry[element], arry[rchild]); + element = rchild; + } + lchild = element * 2 + 1; + rchild = lchild + 1; + } + if (lchildarry[element]) + { + std::swap(arry[lchild], arry[element]); + } + return; + } + + + template + void HeapSort(T*arry, int size) + { + int i; + for (i = size - 1; i >= 0; i--) + { + MinHeapify(arry, size, i); + } + while (size > 0) + { + std::swap(arry[size - 1], arry[0]); + + size--; + MinHeapify(arry, size, 0); + } + return; + } + +} diff --git a/othersoft/shuttercali/source/pch.h b/othersoft/shuttercali/source/pch.h new file mode 100644 index 0000000..d5ac3af --- /dev/null +++ b/othersoft/shuttercali/source/pch.h @@ -0,0 +1,28 @@ +#pragma once +#include +////////////////////////////setings +#include +#include +////////////////////////////Basic +#include +#include +#include +#include +#include +////////////////////////////Thread +#include +#include +#include +////////////////////////////json +#include +#include +#include +#include +#include +////////////////////////////time +#include +#include +#include +////////////////////////////Serial I/O +#include +#include \ No newline at end of file diff --git a/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.cpp b/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.cpp new file mode 100644 index 0000000..58069ad --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.cpp @@ -0,0 +1,82 @@ +#include "OptoSkyManager.h" + +OptoSkyManager::OptoSkyManager(QObject *parent) + : QObject(parent) +{ +} + +OptoSkyManager::~OptoSkyManager() +{ +} + +void OptoSkyManager::optall() +{ + +} + +void OptoSkyManager::getdata() +{ + +} + +void OptoSkyManager::readconnect() +{ + +} + +void OptoSkyManager::loadtcp() +{ + +} + +bool OptoSkyManager::readbutdonothing(int size) +{ + return true; +} + +bool OptoSkyManager::reloadtcp() +{ + return true; +} + +void OptoSkyManager::ChangeArrEnding(float *data, int lenth) +{ + +} + +void OptoSkyManager::conecet() +{ + +} + +void OptoSkyManager::sendMessage() +{ + +} + +void OptoSkyManager::onReciveData() +{ + +} + +void OptoSkyManager::sendgotdata() +{ + +} + +void OptoSkyManager::ComFromUI(QString commom) +{ + +} + +void OptoSkyManager::ondisconnect() +{ + +} + +void OptoSkyManager::ReadError(QAbstractSocket::SocketError) +{ + +} + + diff --git a/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.h b/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.h new file mode 100644 index 0000000..f2cafed --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/OptoSkyManager.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include "QtEndian" +#include "QTimer" +#include "QTcpSocket" +class OptoSkyManager : public QObject +{ + Q_OBJECT + +public: + OptoSkyManager(QObject *parent); + ~OptoSkyManager(); + void optall(); + void getdata(); + void readconnect(); + QString actionmod; + QTimer *timer; + int waittime; + int temp1, temp2; + void loadtcp(); + bool isreadtogotdata; + bool readbutdonothing(int size); + bool reloadtcp(); + float darkarry[2151]; + int flatwite; + int flatdark; + QString processstr; + QString IP_Address; + int SampleAverage; + int WhiteReferenceAverage; + int DarkCurrentAverage; + +private: + void ChangeArrEnding(float *data, int lenth); +public slots: + void conecet(); + void sendMessage(); + void onReciveData(); + void sendgotdata(); + void ComFromUI(QString commom); + /* void gotdata();*/ + void ondisconnect(); + void ReadError(QAbstractSocket::SocketError); + + +signals: + void Senddatatoui(QString datatype, QByteArray data); + void UpdataProcessBar(QString str, int val); +}; diff --git a/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.cpp b/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.cpp new file mode 100644 index 0000000..e41b7bc --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.cpp @@ -0,0 +1,204 @@ +#include "OptoSkyType.h" +#include +#include +#include "QTime" +#include "logout.h" +QSerialPort *optoskyserial = nullptr; +bool IsOptoskyinit = false; +#include"qdebug.h" +void OptoSky::SetPortName(QString comname, qint32 bandrate) +{ + + QSerialPortInfo info; + QList infos = QSerialPortInfo::availablePorts(); + int i = 0; + qDebug() << comname; + foreach(info, infos) { + if (info.portName() == comname) break; + qDebug() << info.portName(); + i++; + } + if (i != infos.size()) + { + if (optoskyserial == nullptr) + { + optoskyserial = new QSerialPort; + } + optoskyserial->close(); + optoskyserial->setPort(info); + optoskyserial->open(QIODevice::ReadWrite); + qint32 b = bandrate; + optoskyserial->setBaudRate(b); + } + else + { + IsOptoskyinit = false; + return; + } + IsOptoskyinit = true; + +} + +void OptoSky::closeport() +{ + if (optoskyserial!=nullptr) + { + delete optoskyserial; + optoskyserial = nullptr; + } +} + +void OptoSky::SendComment(QByteArray Comment) +{ + unsigned short lenth = Comment.size() + 3; + QByteArray header; + header.resize(4); + header[0] = 0xaa; + header[1] = 0x55; + header[2] = lenth / 256; + header[3] = lenth % 256; + header.append(Comment); + int sum = 0; + for (int i = 0; i < lenth-1; i++) + { + sum = sum +header[i+2]; + } + header.append(sum % 256); + if (IsOptoskyinit) + { + optoskyserial->readAll(); + optoskyserial->write(header); + optoskyserial->waitForBytesWritten(200); + + } + //char *a = header.data(); + //int c=sizeof(header); + +} + +bool OptoSky::GetReturn(char id, QByteArray &data) +{ + QByteArray b; + b.append(id); + return GetReturn(b, data); +} + +bool OptoSky::GetReturn(QByteArray &data) +{ + data.clear(); + + data = optoskyserial->readAll(); + QTime time; + time.start(); +lable1: + while (data.size() < 5) + { + optoskyserial->waitForReadyRead(50); + QByteArray tempbuf = optoskyserial->readAll(); + data.append(tempbuf); + + if (time.elapsed() > 50000) + { + logout::out("long time no data retrun "); + return false; + + } + } + if ((unsigned char)data[0] != 0xaa || (unsigned char)data[1] != 0x55) + { + data.remove(0, 1); + goto lable1; + } + + int datalenth = data[2] * 256 + data[3] + 2; + + while (data.size() < datalenth) + { + optoskyserial->waitForReadyRead(50); + data.append(optoskyserial->readAll()); + + if (time.elapsed() > 50000) + { + logout::out("long time no data retrun " ); + return false; + + } + } + + if (data.size() > datalenth) + { + data.remove(datalenth - 1, data.size() - datalenth); + } + int checkleth = datalenth - 3; + unsigned int checknum = 0; + for (size_t i = 0; i < checkleth; i++) + { + + checknum = checknum + data.at(i + 2); + } + checknum = checknum % 256; + if (checknum != (unsigned char)data[data.size() - 1]) + { + logout::out("checkerro " ); + data.clear(); + return false; + } + return true; + +} + +bool OptoSky::GetReturn(QByteArray id, QByteArray &data) +{ + if (!GetReturn(data)) + { + return false; + } + + if (data[4]!=id[0]) + { + logout::out("retrun is not correct with ComId:" + QString::number(id[0], 16)); + return false;//زҪ򷵻ش + } + + RemoveHeaderandEnd(data); + return true; + +} + +void OptoSky::SendComment(char comid, QByteArray Data) +{ + QByteArray tem; + tem.append(comid); + tem.append(Data); + SendComment(tem); +} + +void OptoSky::SendComment(char com) +{ + QByteArray temp; + temp.append(com); + SendComment(temp); +} + +bool OptoSky::isSensorInit() +{ + return IsOptoskyinit; +} + +void OptoSky::RemoveHeaderandEnd(QByteArray &buf) +{ + if (buf.size() < 6) + { + return; + } + buf.remove(0, 5); + buf.remove(buf.size() - 1, 1); +} + +void OptoSky::SendComment(QByteArray Comment, QByteArray Data) +{ + Comment.append(Data); + SendComment(Comment); +} + + diff --git a/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.h b/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.h new file mode 100644 index 0000000..b71044a --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/OptoSkyType.h @@ -0,0 +1,77 @@ +#pragma once +/****************************************************** +* ļ : OptoSkyType.h +* : +* : +* : xin +* : renlixin@iris-rs.cn +* : 2021-2-22 +******************************************************** +* * +* _ooOoo_ * +* o8888888o * +* 88" . "88 * +* (| -_- |) * +* O\ = /O * +* ____/`---'\____ * +* .' \\| |// `. * +* / \\||| : |||// \ * +* / _||||| -:- |||||- \ * +* | | \\\ - /// | | * +* | \_| ''\---/'' | | * +* \ .-\__ `-` ___/-. / * +* ___`. .' /--.--\ `. . __ * +* ."" '< `.___\_<|>_/___.' >'"". * +* | | : `- \`.;`\ _ /`;.`/ - ` : | | * +* \ \ `-. \_ __\ /__ _/ .-` / / * +* ======`-.____`-.___\_____/___.-`____.-'====== * +* `=---=' * +* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * +* 汣 * +* * +********************************************************/ + + + +#include "QByteArray" +#include"QString" +#define GET_MODEBOARD_TEMP 0x01 +#define GET_PN_NUMBER 0x03 +#define GET_SN_NUMBER 0x04 +#define GET_MANUFACTURE_DATA 0x06 +#define GET_MANUFACTOR_INFO 0x09 +#define GET_PIXEL_LENGTH 0x0a +#define GET_TEC_TEMP 0x13 +#define SET_TEC_TEMP 0x12 +#define GET_OPTICFLAT_TEMP 0x35 +#define GET_CIRCUIT_BOARD_TEMP 0x36 +#define SET_INTEGRAL_TIME 0x14 +#define GET_INTEGRAL_TIME 0x41 +#define GET_MAX_INTEGRAL_TIME 0x42 +#define GET_MIN_INTEGRAL_TIME 0x43 +#define ASYNCHRONOUS_COLLECT_DARK 0x23 +#define ASYNCHRONOUS_START_COLLECTION 0x16 +#define ASYNCHRONOUS_READ_DATA 0x17 +#define SET_AVERAGE_NUMBER 0x28 +#define SYNCHRONIZATION_GET_DATA 0x1e +#define SYNCHRONIZATION_GET_DARK 0x2f +#define EXTERNAL_TRIGGER_ENABLE 0x1f +#define SET_XENON_LAMP_DELAY_TIME 0x24 +#define GET_WAVELENGTH_CALIBRATION_COFF 0x55 +#define GET_STAT_OF_LAMPOUT 0x60 +#define SET_GPIO 0x61 +namespace OptoSky +{ + +void SetPortName(QString comname, qint32 bandrate=115200); +void closeport(); +void SendComment(QByteArray Comment); +void SendComment(char comid); +void SendComment(QByteArray Comment, QByteArray Data); +bool GetReturn(QByteArray id, QByteArray &data); +bool GetReturn(char id, QByteArray &data); +bool GetReturn(QByteArray &data); +void SendComment(char comid, QByteArray Data); +bool isSensorInit(); +void RemoveHeaderandEnd(QByteArray &buf); +} \ No newline at end of file diff --git a/othersoft/shuttercali/source_rlx/sensor/OptoskyCommunicater.cpp b/othersoft/shuttercali/source_rlx/sensor/OptoskyCommunicater.cpp new file mode 100644 index 0000000..e69de29 diff --git a/othersoft/shuttercali/source_rlx/sensor/SeaBreeze.dll b/othersoft/shuttercali/source_rlx/sensor/SeaBreeze.dll new file mode 100644 index 0000000..607b18d Binary files /dev/null and b/othersoft/shuttercali/source_rlx/sensor/SeaBreeze.dll differ diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorBase.cpp b/othersoft/shuttercali/source_rlx/sensor/SensorBase.cpp new file mode 100644 index 0000000..92f3143 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorBase.cpp @@ -0,0 +1,14 @@ + +#include "SensorBase.h" + + + +SensorBase::SensorBase() + +{ + SensorInfo.isSensorInit = false; +} + +SensorBase::~SensorBase() +{ +} diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorBase.h b/othersoft/shuttercali/source_rlx/sensor/SensorBase.h new file mode 100644 index 0000000..6c89081 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorBase.h @@ -0,0 +1,132 @@ +#pragma once + +#include +/****************************************************** +* ļ : SensorBase.cpp +* : 豸 +* : +* : xin +* : renlixin@iris-rs.cn +* : 2021-1-15 +******************************************************** +* * +* _ooOoo_ * +* o8888888o * +* 88" . "88 * +* (| -_- |) * +* O\ = /O * +* ____/`---'\____ * +* .' \\| |// `. * +* / \\||| : |||// \ * +* / _||||| -:- |||||- \ * +* | | \\\ - /// | | * +* | \_| ''\---/'' | | * +* \ .-\__ `-` ___/-. / * +* ___`. .' /--.--\ `. . __ * +* ."" '< `.___\_<|>_/___.' >'"". * +* | | : `- \`.;`\ _ /`;.`/ - ` : | | * +* \ \ `-. \_ __\ /__ _/ .-` / / * +* ======`-.____`-.___\_____/___.-`____.-'====== * +* `=---=' * +* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * +* 汣 * +* * +********************************************************/ +///һ delete +enum emDataType +{ + DNVALUE=1, + REFVALUE=2, + DARKNESS=3 +}; +struct STROnePlot +{ + long BandNum; + float *Plot; + bool isInit; + float temp; + float shutter; + QStringList wavelenthlist; + long maxDNvalue; + bool hasDarkCorrect; + emDataType DataType; + STROnePlot() { + BandNum = 0; + isInit = false; + hasDarkCorrect = false; + Plot = nullptr; + DataType = DNVALUE; + } + ~STROnePlot() { + if (!isInit) + { + delete[] Plot; + isInit = false; + } + + } + +}; +struct STRSensorInfo +{ + QString SensorName; + long maxValue; + long BandNum; + QString WavelenthStr; + QStringList wavelenthlist; + //double *wavelenth; + bool isSensorInit; + QString serialnumber; + +}; + +class SensorBase : public QObject +{ + Q_OBJECT + +public: + SensorBase(); + virtual ~SensorBase(); + //************************************ + // Method: ʼ + // FullName: SensorBase::initSensor + // Access: virtual public + // Returns: void + // Qualifier: + //************************************ + virtual bool initSensor(int id=0)=0; + //************************************ + // Method: Settingshuttertime ûʱ + // FullName: SensorBase::Settingshuttertime + // Access: virtual public + // Returns: void + // Qualifier: + // Parameter: int msc + //************************************ + virtual void Settingshuttertime(float msc)=0; + //************************************ + // Method: SettingTemprature ¶ + // FullName: SensorBase::SettingTemprature + // Access: virtual public + // Returns: void + // Qualifier: + // Parameter: float temp + //************************************ + virtual void SettingTemprature(float temp)=0; + virtual float GettingTempratrue() = 0; + virtual STRSensorInfo GetSensorInfo()=0; + virtual void SettingShutterOpen(bool isopen)=0; + virtual void SettingSwitchShutter(bool isright)=0; + virtual void GetOnePlot(STROnePlot &OnePlot,bool Dark=false)=0; + virtual void CloseSensor()=0; + + virtual void GetOneDark(STROnePlot &darkplot) = 0; + + + + QString SensorType; + int Sensorid; + STRSensorInfo SensorInfo; + STROnePlot DarkNess; + +}; diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorMannager.cpp b/othersoft/shuttercali/source_rlx/sensor/SensorMannager.cpp new file mode 100644 index 0000000..5da4026 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorMannager.cpp @@ -0,0 +1,238 @@ +#include "SensorMannager.h" +#include "SensorQExPRO.h" +#include +#include "logout.h" +#include "QDateTime" +#include "QLocale" +#include"SensorOptoSky.h" +int maxtime = 30000; +SensorMannager::SensorMannager(QObject *parent ) + : QObject(parent) +{ + + Numberofscan = 5; + //Sensor = new SensorQExPRO(QEPRO_QE); + Sensor = new SensorOptoSky(ATP6500,"COM12"); + Sensor->initSensor(); +} + +SensorMannager::~SensorMannager() +{ + delete Sensor; + logout::out("˳",1); + +} + +void SensorMannager::opensensor() +{ + Sensor->initSensor(); +} + +void SensorMannager::CloseSensor() +{ + Sensor->CloseSensor(); +} + +long SensorMannager::SensorOpt(int persent) +{ + long maxvalue = Sensor->SensorInfo.maxValue*1.0*persent / 100; + STROnePlot plot; + long maxvaluenow = 0; + float shutternow = 10; + if (Sensor->SensorType=="USB2000PLUS") + { + // shutternow = 1; + } + + Sensor->Settingshuttertime(shutternow); + + Sensor->GetOnePlot(plot); + if (!plot.isInit) + { + return -1; + } + maxvaluenow = Getmaxvalue(plot.Plot,4, plot.BandNum-4); + logout::out("ԶعΪ: " + QString::number(shutternow) + " ֵΪ" + QString::number(maxvaluenow),1); + //QThread::msleep(1000); + int numberoftry = 0; + while (maxvaluenowmaxvalue) + { + + if (maxvaluenow > maxvalue) + { + shutternow = shutternow *0.9; + } + else + { + shutternow = maxvalue * 0.98 / (maxvaluenow * 1.0)*shutternow + 1; + } + if (shutternow>maxtime) + { + shutternow = maxtime; + } + //QThread::msleep(100); + Sensor->Settingshuttertime(shutternow); + Sensor->GetOnePlot(plot); + if (plot.isInit) + { + maxvaluenow = Getmaxvalue(plot.Plot, 4, plot.BandNum - 4); + + } + + + numberoftry++; + + logout::out("ԶعΪ: " + QString::number(shutternow) + " ֵΪ"+QString::number(maxvaluenow),1); + if (numberoftry>200) + { + logout::out("عⳢԴ عʧ",3); + return -1; + + } + if (shutternow == maxtime) + { + logout::out("عʱﵽʱ",3); + return -1*maxtime; + } + + } + logout::out("عɹ عʱΪ: "+QString::number(shutternow)+" ",1); + return shutternow; + +} + +long SensorMannager::Getmaxvalue(float *arr, int start, int lenth) +{ + long val = -1; + for (size_t i = start; i < lenth; i++) + { + if (val <= arr[i]) + { + val = arr[i]; + } + + } + return val; +} + +void SensorMannager::SetnumbertoGot(int nscan) +{ + Numberofscan = nscan; +} + +void SensorMannager::GetSifData(QString outfilepath, bool isskyfirs /*= true*/) +{ + + Sensor->SettingShutterOpen(true);//ȷshutter + QThread::msleep(50); + Sensor->SettingSwitchShutter(true);//лΪsky + logout::out("Switch лSKY",1); + QThread::msleep(50); + //////////////////////////Ż//////////////////////////////////////////////// + float skyshutter=SensorOpt(); + for (size_t i = 0; i < 3; i++) + { + + if (skyshutter!=-1) + { + break; + } + skyshutter = SensorOpt(); + + } + ///////////////////////////////////////////// + if (skyshutter==-1)//optκδ-1 ˵ + { + logout::out(" ",3); + return; + } + skyshutter = abs(skyshutter); + Sensor->SettingSwitchShutter(false);//лΪVEG + logout::out("Switch лVEG",1); + QThread::msleep(50); + //////////////////////////veg//////////////////////////////////////////////// + float vegshutter = SensorOpt(); + for (size_t i = 0; i < 3; i++) + { + if (vegshutter ==-1 ) + { + break; + } + vegshutter = SensorOpt(); + + } + if (vegshutter == -1) + { + logout::out(" ",3); + return; + } + vegshutter = abs(vegshutter); + //////////////////////////ģָ//////////////////////////////////////////////// + + //////////////////////////򿪴ļ//////////////////////////////////////////////// + FILE *fp = fopen(outfilepath.toStdString().c_str(), "w"); + if (fp==NULL) + { + logout::out("ļ" + outfilepath + "ʧܣ", 3); + return; + } + //fprintf(fp, "%s + STROnePlot oneplot; + float tempp = Sensor->GettingTempratrue(); + WriteTitletoCSV(fp, Sensor->SensorInfo.SensorName,Numberofscan, tempp, Sensor->SensorInfo.WavelenthStr, skyshutter, vegshutter); + logout::setoutlevel(10); + Sensor->SettingSwitchShutter(true);//лsky + Sensor->Settingshuttertime(skyshutter); + for (size_t i = 0; i < Numberofscan; i++) + { + logout::out("ʼɼ"+QString::number(i+1)+"Sky "); + Sensor->GetOnePlot(oneplot,true); + writeonedatatoCSV(fp, oneplot); + } + + Sensor->SettingSwitchShutter(false);//лΪVEG + Sensor->Settingshuttertime(vegshutter); + for (size_t i = 0; i < Numberofscan; i++) + { + logout::out("ʼɼ" + QString::number(i+1) + "Veg "); + Sensor->GetOnePlot(oneplot,true); + writeonedatatoCSV(fp, oneplot); + } + fflush(fp); + fclose(fp); + logout::out("ɼ",1); + logout::setoutlevel(); + +} + +void SensorMannager::writeonedatatoCSV(FILE *fp, STROnePlot plot) +{ + //.fprintf(fp, "%s,%s,%s\n", xvaluetoWrite.at(i).toStdString().c_str() + size_t lenth = plot.BandNum; + size_t i; + for (i = 0; i < lenth-1; i++) + { + fprintf(fp, "%s,", QString::number(plot.Plot[i], 'f', 1).toStdString().c_str()); + + } + fprintf(fp, "%s\n", QString::number(plot.Plot[i], 'f', 1).toStdString().c_str()); +} + +void SensorMannager::WriteTitletoCSV(FILE *fp, QString sensname, int NmberofScan, float temp, QString wavestring, float skyshutter, float vegshutter) +{ + if (fp == NULL) + { + return; + } + QDateTime datetime = QDateTime::currentDateTime(); + QLocale locale = QLocale::English; + QString datestr = locale.toString(datetime, "ddd MMM dd hh:mm:ss yyyy"); + fprintf(fp, "observation date and time: %s\n", datestr.toStdString().c_str()); + fprintf(fp, "numberofscan: %s\n", QString::number(Numberofscan).toStdString().c_str()); + fprintf(fp, "spectrometer: %s\n", sensname.toStdString().c_str()); + fprintf(fp, "ambient temperature: %s\n", QString::number(temp,'f',2).toStdString().c_str()); + fprintf(fp, "%s\n", wavestring.toStdString().c_str()); + fprintf(fp, "integration time 1: %s\n", QString::number(skyshutter, 'f', 2).toStdString().c_str()); + fprintf(fp, "integration time 2: %s\n", QString::number(vegshutter, 'f', 2).toStdString().c_str()); +} + diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorMannager.h b/othersoft/shuttercali/source_rlx/sensor/SensorMannager.h new file mode 100644 index 0000000..10d4bd7 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorMannager.h @@ -0,0 +1,78 @@ +#pragma once +/****************************************************** +* ļ : SensorMannager.h +* : +* : +* : xin +* : renlixin@iris-rs.cn +* : 2021-2-22 +******************************************************** +* * +* _ooOoo_ * +* o8888888o * +* 88" . "88 * +* (| -_- |) * +* O\ = /O * +* ____/`---'\____ * +* .' \\| |// `. * +* / \\||| : |||// \ * +* / _||||| -:- |||||- \ * +* | | \\\ - /// | | * +* | \_| ''\---/'' | | * +* \ .-\__ `-` ___/-. / * +* ___`. .' /--.--\ `. . __ * +* ."" '< `.___\_<|>_/___.' >'"". * +* | | : `- \`.;`\ _ /`;.`/ - ` : | | * +* \ \ `-. \_ __\ /__ _/ .-` / / * +* ======`-.____`-.___\_____/___.-`____.-'====== * +* `=---=' * +* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * +* 汣 * +* * +********************************************************/ + + + +#include +#include "SensorBase.h" +enum SensorType +{ + QESENSOR = 1, + + +}; + + + + +class SensorMannager : public QObject +{ + Q_OBJECT + +public: + SensorMannager(QObject *parent=0 ); + ~SensorMannager(); + SensorBase *Sensor; + //************************************ + // Method: SensorOpt ԶŻ persentΪĬŻĿ 0100 Ĭ100 + // FullName: SensorMannager::SensorOpt + // Access: public + // Returns: void + // Qualifier: + // Parameter: int persent + //************************************ + void opensensor(); + void CloseSensor(); + long SensorOpt(int persent=100); + + long Getmaxvalue(float *arr, int start, int lenth); + void SetnumbertoGot(int nscan); + void GetSifData(QString outfilepath,bool isskyfirs = true); +private: + int Numberofscan; + void writeonedatatoCSV(FILE *fp, STROnePlot plot); + void WriteTitletoCSV(FILE *fp,QString sensname, int NmberofScan, float temp, QString wavestring, float skyshutter, float vegshutter); +}; + + + diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorOptoSky.cpp b/othersoft/shuttercali/source_rlx/sensor/SensorOptoSky.cpp new file mode 100644 index 0000000..0258871 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorOptoSky.cpp @@ -0,0 +1,306 @@ +#include "SensorOptoSky.h" +#include "OptoSkyType.h" +#include "logout.h" +#include "QtEndian" +using namespace OptoSky; +SensorOptoSky::SensorOptoSky(OPTOSENSORTYPE type, QString comname, qint32 bandrate) + +{ + sensortype = type; + SensorType = "opt"; + SensorInfo.SensorName = "opotsky"; + COMname = comname; + BandRate = bandrate; + shutter.resize(2); + + //SendComment(comi); +} + +SensorOptoSky::SensorOptoSky(OPTOSENSORTYPE type, QString comname) +{ + + sensortype = type; + SensorType = "opt"; + SensorInfo.SensorName = "opotsky"; + COMname = comname; + BandRate = 115200; + shutter.resize(2); +} + +bool SensorOptoSky::initSensor(int id /*= 0*/) +{ + + + OptoSky::SetPortName(COMname, BandRate); + if (!OptoSky::isSensorInit()) + { + return false; + } + + SensorInfo = GetSensorInfo(); + float a = GettingTempratrue(); + //SendComment() + return true; +} + +void SensorOptoSky::Settingshuttertime(float msc) +{ + if (!OptoSky::isSensorInit()) + { + return; + } + shuttertime = (int)msc; + shutter[0] = (int)msc / 256; + shutter[1] = (int)msc % 256; + QByteArray temp; + SendComment(SET_INTEGRAL_TIME,shutter); + GetReturn(SET_INTEGRAL_TIME,temp); +} + +void SensorOptoSky::SettingTemprature(float temp) +{ + QByteArray buf; + buf.resize(2); + + if (temp<0) + { + buf[0] = 0xff; + } + else + { + buf[1] = 0x00; + + } + buf[1] = (int)abs(temp); + SendComment(SET_TEC_TEMP, buf); + GetReturn(SET_TEC_TEMP, buf); + +} + +float SensorOptoSky::GettingTempratrue() +{ + if (!OptoSky::isSensorInit()) + { + return 0; + } + QByteArray buf; + SendComment(GET_TEC_TEMP); + GetReturn(GET_TEC_TEMP, buf); + QString str; + str.append(buf); + float ret = str.toFloat(); + return ret; +} + +STRSensorInfo SensorOptoSky::GetSensorInfo() +{ + STRSensorInfo setem; + if (!OptoSky::isSensorInit()) + { + return setem; + } + STRSensorInfo se; + QByteArray buf; + SendComment(GET_PN_NUMBER); + GetReturn(GET_PN_NUMBER, buf); + QString str; + str.append(buf); + se.SensorName = str; + logout::out("豸ͺΪ" + str); + SendComment(GET_SN_NUMBER); + GetReturn(GET_SN_NUMBER, buf); + str.clear(); + str.append(buf); + logout::out("кΪ" + str); + SendComment(GET_PIXEL_LENGTH); + GetReturn(GET_PIXEL_LENGTH, buf); + se.BandNum = buf[0] * 256 + buf[1]; + //////////////////////////ģָ//////////////////////////////////////////////// + Settingshuttertime(6); + SendComment(SYNCHRONIZATION_GET_DATA); + GetReturn(SYNCHRONIZATION_GET_DATA, buf); + se.BandNum = (buf.size() - 1)/2; + //////////////////////////ģָ//////////////////////////////////////////////// + getwavelenthlist(se); + //ȡ޷ȡ ֵδȡ + //////////////////////////ģָ//////////////////////////////////////////////// + QByteArray bbb; + bbb.resize(2); + bbb[0] = 0x00; + bbb[1] = 0x01; + SendComment(SET_AVERAGE_NUMBER, bbb); + GetReturn(SET_AVERAGE_NUMBER, bbb); + se.maxValue = 65535; + return se; +} + +void SensorOptoSky::SettingShutterOpen(bool isopen) +{ + +} + +void SensorOptoSky::SettingSwitchShutter(bool isright) +{ + +} + +void SensorOptoSky::GetOnePlot(STROnePlot &OnePlot, bool Dark) +{ + OnePlot.temp = GettingTempratrue(); + + SendComment(SYNCHRONIZATION_GET_DATA,shutter); + OnePlot.shutter = shuttertime; + QByteArray buf; + if (!GetReturn(SYNCHRONIZATION_GET_DATA, buf)) + { + OnePlot.isInit = false; + return; + } + + + if ((unsigned char )buf[0]==0x00) + { + //OnePlot.isInit = true; + } + else + { + OnePlot.isInit = false; + } + int bandsumnwo = SensorInfo.BandNum; + unsigned short *arr = new unsigned short[bandsumnwo]; + memcpy(arr, buf.data() + 1, bandsumnwo*2); + if (!OnePlot.isInit) + { + OnePlot.Plot = new float[bandsumnwo]; + OnePlot.isInit = true; + } + + for (size_t i = 0; i < bandsumnwo; i++) + { + OnePlot.Plot[i] = qToBigEndian(arr[i]); + } + delete[] arr; + OnePlot.BandNum = bandsumnwo; + OnePlot.maxDNvalue = SensorInfo.maxValue; + OnePlot.wavelenthlist = SensorInfo.wavelenthlist; + if (Dark) + { + if (DarkNess.isInit) + { + if (DarkNess.shutter != shuttertime) + { + GetOneDark(DarkNess); + } + + } + else + { + GetOneDark(DarkNess); + } + + for (size_t i = 0; i < bandsumnwo; i++) + { + OnePlot.Plot[i] = OnePlot.Plot[i] - DarkNess.Plot[i]; + } + } + +} + +void SensorOptoSky::CloseSensor() +{ + closeport(); +} + +void SensorOptoSky::GetOneDark(STROnePlot &darkplot) +{ + STROnePlot &OnePlot = darkplot; + OnePlot.temp = GettingTempratrue(); + OnePlot.shutter = shuttertime; + SendComment(SYNCHRONIZATION_GET_DARK, shutter); + QByteArray buf; + if (!GetReturn(SYNCHRONIZATION_GET_DARK, buf)) + { + OnePlot.isInit = false; + return; + } + + + if ((unsigned char)buf[0] == 0x00) + { + //OnePlot.isInit = true; + } + else + { + OnePlot.isInit = false; + } + int bandsumnwo = SensorInfo.BandNum; + unsigned short *arr = new unsigned short[bandsumnwo]; + memcpy(arr, buf.data() + 1, bandsumnwo * 2); + if (!OnePlot.isInit) + { + OnePlot.Plot = new float[bandsumnwo]; + OnePlot.isInit = true; + } + for (size_t i = 0; i < bandsumnwo; i++) + { + OnePlot.Plot[i] = qToBigEndian(arr[i]); + + + } + delete[] arr; + OnePlot.BandNum = bandsumnwo; + OnePlot.maxDNvalue = SensorInfo.maxValue; + OnePlot.wavelenthlist = SensorInfo.wavelenthlist; + OnePlot.DataType = DARKNESS; + +} + +SensorOptoSky::~SensorOptoSky() +{ + CloseSensor(); +} + +void SensorOptoSky::RemoveHeaderandEnd(QByteArray &buf) +{ + if (buf.size()<6) + { + return; + } + buf.remove(0, 5); + buf.remove(buf.size() - 1,1); + +} + +void SensorOptoSky::getwavelenthlist(STRSensorInfo &se) +{ + if (!OptoSky::isSensorInit()) + { + return ; + } + QByteArray bufin; + bufin.resize(2); + bufin[0] = 0x00; + bufin[1] = 0x01; + QByteArray buf; + SendComment(GET_WAVELENGTH_CALIBRATION_COFF,bufin); + GetReturn(GET_WAVELENGTH_CALIBRATION_COFF, buf); + float a[4]; + memcpy(a, buf.data() + 16, 4 * 4); + int bandsss = se.BandNum; + QStringList strlist; + QString str=""; + int i = 0; + for ( i = 0; i _/___.' >'"". * +* | | : `- \`.;`\ _ /`;.`/ - ` : | | * +* \ \ `-. \_ __\ /__ _/ .-` / / * +* ======`-.____`-.___\_____/___.-`____.-'====== * +* `=---=' * +* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * +* 汣 * +* * +********************************************************/ + + + +#include +enum OPTOSENSORTYPE +{ + ATP6500 = 1 +}; +class SensorOptoSky : public SensorBase +{ + Q_OBJECT + +public: + SensorOptoSky(OPTOSENSORTYPE type, QString comname); + SensorOptoSky(OPTOSENSORTYPE type, QString comname, qint32 bandrate); + bool initSensor(int id = 0); + void Settingshuttertime(float msc) ; + //************************************ + // Method: SettingTemprature ¶ + // FullName: SensorBase::SettingTemprature + // Access: virtual public + // Returns: void + // Qualifier: + // Parameter: float temp + //************************************ + void SettingTemprature(float temp); + float GettingTempratrue() ; + STRSensorInfo GetSensorInfo(); + void SettingShutterOpen(bool isopen); + void SettingSwitchShutter(bool isright); + void GetOnePlot(STROnePlot &OnePlot, bool Dark=false) ; + void CloseSensor() ; + + void GetOneDark(STROnePlot &darkplot); + + + + OPTOSENSORTYPE sensortype; + QString COMname; + qint32 BandRate; + ~SensorOptoSky(); +private: + void RemoveHeaderandEnd(QByteArray &buf); + void getwavelenthlist( STRSensorInfo &se); + QByteArray shutter; + int shuttertime; + +}; diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.cpp b/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.cpp new file mode 100644 index 0000000..1b5a363 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.cpp @@ -0,0 +1,327 @@ +#include "SensorQExPRO.h" +#include "QDebug" +#include "api/seabreezeapi/SeaBreezeAPI.h" +#include "logout.h" +#include "QMetaEnum" +#include "QThread" +SensorQExPRO::SensorQExPRO(EMQEType qetype) + +{ + QEType = qetype; + if (qetype==QEPRO_QE) + { + + } + else if(qetype == USB2000PLUS_QE) + { + + } + else + { + OutputMod = nullptr; + Shuteroffcom = nullptr; + Shuteroncom = nullptr; + } + +} + +SensorQExPRO::~SensorQExPRO() +{ + if (SensorInfo.isSensorInit) + { + sbapi_shutdown(); + } + + +} + +bool SensorQExPRO::initSensor(int id) +{ + sbapi_shutdown(); + sbapi_initialize(); + sbapi_probe_devices(); + int number_of_QE = sbapi_get_number_of_device_ids(); + logout::out("ҵ " + QString::number(number_of_QE) + "豸",2); + if (number_of_QE <= id) + { + return false; + } + Device_ids=new long[number_of_QE](); + sbapi_get_device_ids(Device_ids, number_of_QE); + logout::out("豸idΪ" + QString::number(Device_ids[id]),2); + DeviceId = Device_ids[id]; + + char namearr[100]; + //ȡ + FLAG= sbapi_get_device_type(DeviceId, &ERR, namearr, 99); + if (FLAG!=0) + { + QString sensorname = QString(namearr); + QEType = getEMUbyQstring(sensorname); + SensorType = sensorname; + SensorInfo.SensorName = sensorname; + logout::out("豸ͺţ" + sensorname,2); + } + Sensorid = DeviceId; + //豸 + FLAG= sbapi_open_device(DeviceId, &ERR); + logout::out("豸򿪣" + QString(sbapi_get_error_string(ERR)),2); + if (FLAG!=0) + { + //ʧ false + return false; + } + SensorInfo.isSensorInit = true; + int maxf=sbapi_get_number_of_shutter_features(DeviceId, &ERR);; + long fff; +// sbapi_get_shutter_features(DeviceId, &ERR, &fff,maxf); +// sbapi_shutter_set_shutter_open(DeviceId, fff,&ERR, 0); +// logout::out("豸򿪣" + QString(sbapi_get_error_string(ERR))); +// qDebug() << "hello"; + SensorInfo=GetSensorInfo(); + + + //Ϊ¶ȶõ + Numberoftempratrue= sbapi_get_number_of_thermo_electric_features(DeviceId, &ERR); + TemPratrueId=new long[Numberoftempratrue](); + Numberoftempratrue=sbapi_get_thermo_electric_features(DeviceId, &ERR, TemPratrueId, Numberoftempratrue); + sbapi_tec_set_enable(DeviceId, TemPratrueId[0], &ERR, 1); + return true; +} + +void SensorQExPRO::Settingshuttertime(float msc) +{ + if (!SensorInfo.isSensorInit) + { + return; + } + shuttertime = msc; + sbapi_spectrometer_set_integration_time_micros(DeviceId, SpecMetersId[0], &ERR, msc*1000); + //logout::out("عʱ䣺" + QString(sbapi_get_error_string(ERR)),2); +} + +void SensorQExPRO::SettingTemprature(float temp) +{ + sbapi_tec_set_temperature_setpoint_degrees_C(DeviceId, TemPratrueId[0], &ERR,temp); + QThread::msleep(100); +} + +STRSensorInfo SensorQExPRO::GetSensorInfo() +{ + STRSensorInfo sensorinof; + //return sensorinof; + if (!SensorInfo.isSensorInit) + { + return sensorinof; + } + int ERR=0; + + sensorinof.isSensorInit = true; + sensorinof.BandNum= sbapi_get_number_of_spectrometer_features(DeviceId, &ERR); + SpecMetersId = new long[sensorinof.BandNum](); + int numm= sbapi_get_spectrometer_features(DeviceId, &ERR, SpecMetersId, sensorinof.BandNum); + sensorinof.BandNum = sbapi_spectrometer_get_formatted_spectrum_length(DeviceId, SpecMetersId[0], &ERR); + double *wavelenth = new double[sensorinof.BandNum](); + sbapi_spectrometer_get_wavelengths(DeviceId, SpecMetersId[0], &ERR,wavelenth, sensorinof.BandNum); + sensorinof.wavelenthlist.clear(); + sensorinof.WavelenthStr = ""; + int i = 0; + for (i = 0; i < sensorinof.BandNum-1; i++) + { + sensorinof.WavelenthStr = sensorinof.WavelenthStr + QString::number(wavelenth[i], 'f', 4)+","; + sensorinof.wavelenthlist.append(QString::number(wavelenth[i], 'f', 4)); + + } + sensorinof.WavelenthStr = sensorinof.WavelenthStr + QString::number(wavelenth[i], 'f', 4); + sensorinof.wavelenthlist.append(QString::number(wavelenth[i], 'f', 4)); + sensorinof.maxValue = sbapi_spectrometer_get_maximum_intensity(DeviceId, SpecMetersId[0], &ERR); + char namearr[100]; + //ȡ + FLAG = sbapi_get_device_type(DeviceId, &ERR, namearr, 99); + if (FLAG != 0) + { + QString sensorname = QString(namearr); + QEType = getEMUbyQstring(sensorname); + SensorType = sensorname; + sensorinof.SensorName = sensorname; + logout::out("豸ͺţ" + sensorname, 2); + } + return sensorinof; +} + +void SensorQExPRO::SettingShutterOpen(bool isopen) +{ + //ݮ 4 + system("gpio mode 4 output"); + if (isopen) + { + system("gpio write 4 1"); + logout::out(" Shutter gpio",2); + } + else + { + system("gpio write 4 0"); + logout::out("ر Shutter gpio",2); + } + if (QEType==QEPRO_QE) + { + + SetQEProShutter(isopen); + } + QThread::msleep(100); + +} + +void SensorQExPRO::SettingSwitchShutter(bool isright) +{ + system("gpio mode 5 output"); + if (isright) + { + system("gpio write 5 1"); + logout::out("лSKY",2); + } + else + { + system("gpio write 5 0"); + logout::out("лVEG",2); + } + +} + +void SensorQExPRO::GetOnePlot(STROnePlot &OnePlot, bool Dark) +{ + if (!SensorInfo.isSensorInit) + { + return; + } + if (!OnePlot.isInit || OnePlot.BandNum != SensorInfo.BandNum) + { + if (OnePlot.isInit) + { + + delete[] OnePlot.Plot; + } + OnePlot.Plot = new float[SensorInfo.BandNum]; + OnePlot.BandNum = SensorInfo.BandNum; + + } + if (!SensorInfo.isSensorInit) + { + return; + + } + double *tempvalue = new double[SensorInfo.BandNum]; + OnePlot.shutter = shuttertime; + sbapi_spectrometer_get_formatted_spectrum(DeviceId,SpecMetersId[0], &ERR, tempvalue, SensorInfo.BandNum); + logout::out("ȡݣ" + QString(sbapi_get_error_string(ERR)),5); + if (QEType != USB2000PLUS_QE) + { + OnePlot.temp = GettingTempratrue(); + logout::out("ȡ¶ȣ" + QString(sbapi_get_error_string(ERR)) + " ¶Ϊ" + QString::number(OnePlot.temp, 'f', 2) + "",2); + } + + + for (size_t i = 0; i < SensorInfo.BandNum; i++) + { + OnePlot.Plot[i] = tempvalue[i]; + + } + OnePlot.isInit = true; + delete[] tempvalue; +} + +float SensorQExPRO::GettingTempratrue() +{ + if (!SensorInfo.isSensorInit) + { + return -1000; + } + float temperature = (float)sbapi_tec_read_temperature_degrees_C(DeviceId, TemPratrueId[0], &ERR); + logout::out("ǰ¶Ϊ"+QString::number(temperature,'f',2),2); + return temperature; +} + +void SensorQExPRO::CloseSensor() +{ + if (SensorInfo.isSensorInit) + { + sbapi_shutdown(); + SensorInfo.isSensorInit = false; + } +} + +void SensorQExPRO::GetOneDark(STROnePlot &darkplot) +{ + +} + +EMQEType SensorQExPRO::getEMUbyQstring(QString str) +{ + if (str=="USB2000PLUS") + { + return USB2000PLUS_QE; + } + if (str == "QE65PRO") + { + return QE65PRO_QE; + } + if (str == "QE-PRO") + { + return QEPRO_QE; + } + if (str == "QE65000") + { + return QE65000_QE; + } + return NONQE; +} + +void SensorQExPRO::SetQEProShutter( bool isopen) +{ + unsigned char GPIO4output[64] = { 0xc1, 0xc0, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc5, 0xc4, 0xc3, 0xc2 + }; + unsigned char GPIO4on[64] = { 0xc1, 0xc0, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc5, 0xc4, 0xc3, 0xc2 + }; + unsigned char GPIO4_off[64] = { 0xc1, 0xc0, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc5, 0xc4, 0xc3, 0xc2 + }; + + long FNid; + int FN = sbapi_get_number_of_raw_usb_bus_access_features(DeviceId, &ERR); + FN = sbapi_get_raw_usb_bus_access_features(DeviceId, &ERR, &FNid, FN); + QThread::msleep(100); + int lenth = sbapi_raw_usb_bus_access_write(DeviceId, FNid, &ERR, GPIO4output, 64, 0x01); + logout::out("shutter Ϊgpio",2); + if (isopen) + { + lenth = sbapi_raw_usb_bus_access_write(DeviceId, FNid, &ERR, GPIO4on, 64, 0x01); + logout::out("ڲShutter",2); + } + else + { + lenth = sbapi_raw_usb_bus_access_write(DeviceId, FNid, &ERR, GPIO4_off, 64, 0x01); + logout::out("رڲShutter",2); + } + + +} diff --git a/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.h b/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.h new file mode 100644 index 0000000..88e11d7 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/SensorQExPRO.h @@ -0,0 +1,63 @@ +#pragma once +#pragma execution_character_set("utf-8") +#include "SensorBase.h" +enum EMQEType +{ + QEPRO_QE=1, + QE65PRO_QE=2, + USB2000PLUS_QE =3, + QE65000_QE = 4, + NONQE=-1 +}; +class SensorQExPRO : public SensorBase +{ + Q_OBJECT + +public: + SensorQExPRO(EMQEType qetype); + ~SensorQExPRO(); + bool initSensor(int id=0); + void Settingshuttertime(float msc); + //************************************ + // Method: SettingTemprature ¶ + // FullName: SensorBase::SettingTemprature + // Access: virtual public + // Returns: void + // Qualifier: + // Parameter: float temp + //************************************ + void SettingTemprature(float temp); + STRSensorInfo GetSensorInfo() ; + void SettingShutterOpen(bool isopen); + //************************************ + // Method: SettingSwitchShutter skyΪright + // FullName: SensorQExPRO::SettingSwitchShutter + // Access: public + // Returns: void + // Qualifier: + // Parameter: bool isright skyΪright + //************************************ + void SettingSwitchShutter(bool isright); + void GetOnePlot(STROnePlot &OnePlot, bool Dark=false); + float GettingTempratrue(); + void CloseSensor(); + void GetOneDark(STROnePlot &darkplot); + EMQEType QEType; +private: + + long *Device_ids; + long DeviceId; + int ERR = 0; + int FLAG = 0; + unsigned char *OutputMod, *Shuteroncom, *Shuteroffcom; + long Numberoftempratrue; + long *TemPratrueId; + long *SpecMetersId; + EMQEType getEMUbyQstring(QString str); + + void SetQEProShutter(bool isopen); + float shuttertime; +; + + +}; diff --git a/othersoft/shuttercali/source_rlx/sensor/TCPServer.h b/othersoft/shuttercali/source_rlx/sensor/TCPServer.h new file mode 100644 index 0000000..548fdc1 --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/TCPServer.h @@ -0,0 +1,301 @@ + +#ifndef _TCPSERVER_H_ +#define _TCPSERVER_H_ +// +// Return Header values. +// +#define H_NO_ERROR (100) +#define H_COLLECT_ERROR (200) +#define H_COLLECT_NOT_LOADED (300) +#define H_INIT_ERROR (400) +#define H_FLASH_ERROR (500) +#define H_RESET_ERROR (600) +#define H_INTERPOLATE_ERROR (700) +#define H_OPTIMIZE_ERROR (800) +#define H_INSTRUMENT_CONTROL_ERROR (900) +// +// Return error codes. +// +#define NO_ERROR_ (0) +#define NOT_READY (-1) +#define NO_INDEX_MARKS (-2) +#define TOO_MANY_ZEROS (-3) +#define SCANSIZE_ERROR (-4) +// -5 unused +#define COMMAND_ERROR (-6) +#define INI_FULL (-7) +#define MISSING_PARAMETER (-8) +// -9 unused - now -20, -21, -22 +#define VNIR_TIMEOUT (-10) +#define SWIR_TIMEOUT (-11) +#define VNIR_NOT_READY (-12) +#define SWIR1_NOT_READY (-13) +#define SWIR2_NOT_READY (-14) +#define VNIR_OPT_ERROR (-15) +#define SWIR1_OPT_ERROR (-16) +#define SWIR2_OPT_ERROR (-17) +#define ABORT_ERROR (-18) +#define PARAM_ERROR (-19) +#define VNIR_INTERP_ERROR (-20) +#define SWIR1_INTERP_ERROR (-21) +#define SWIR2_INTERP_ERROR (-22) +// +// +// +#define MAX_PARAMETERS (200) +// +// Detector Index Value +// +#define SWIR1 (0) +#define SWIR2 (1) +#define VNIR (2) +// +// Instrument Type values +// +#define V_INSTRUMENT_TYPE (1) // VNIR Only +#define DUAL_VNIR_INSTRUMENT_TYPE (2) // Dual VNIR +#define S1_INSTRUMENT_TYPE (4) // SWIR1 Only +#define VS1_INSTRUMENT_TYPE (5) // VNIR and SWIR1 +#define S2_INSTRUMENT_TYPE (8) // SWIR2 ONly +#define VS2_INSTRUMENT_TYPE (9) // VNIR and SWIR2 +#define S1S2_INSTRUMENT_TYPE (12) // SWIR1 and SWIR2 +#define FR_INSTRUMENT_TYPE (13) // VNIR and SWIR1 and SWIR2 +// +// Instrument Control values +// +#define IC_IT (0) +#define IC_GAIN (1) +#define IC_OFFSET (2) +#define IC_SHUTTER (3) +#define IC_TRIGGER (4) +// +// Union used to swap word to make double value +// +union dv +{ + double d; + unsigned long l[sizeof(double) / sizeof(long)]; + unsigned char c[sizeof(double)]; +}; +// +// Vnir Header section +// +struct Vnir_Header +{ + int IT; + int scans; + int max_channel; + int min_channel; + int saturation; + int shutter; + int drift; + int dark_subtracted; + int reserved[8]; +}; +// +// Swir Header section +// +struct Swir_Header +{ + int tec_status; + int tec_current; + int max_channel; + int min_channel; + int saturation; + int A_Scans; + int B_Scans; + int dark_current; + int gain; + int offset; + int scansize1; + int scansize2; + int dark_subtracted; + int reserved[3]; +}; +// +// return Spectrum Header +// +struct SpectrumHeader +{ + int Header; + int errbyte; + int sample_count; + int trigger; + int voltage; + int current; + int temperature; + int motor_current; + int instrument_hours; + int instrument_minutes; + int instrument_type; + int AB; + int reserved[4]; + Vnir_Header v_header; + Swir_Header s1_header; + Swir_Header s2_header; +}; +// +// Acquire structure to return for Full Range Spectrometers +// +struct FRSpecStruct +{ + SpectrumHeader FRHeader; + union + { + float f; + int i; + }SpecBuffer[2151]; +}; + +// +// Acquire structure to return for Vnir Spectrometers +// +struct VSpecStruct +{ + SpectrumHeader VHeader; + union + { + float f; + int i; + }SpecBuffer[701]; +}; +// +// Acquire structure to return for Swir1 Swir2 Spectrometers +// +struct S1S2SpecStruct +{ + SpectrumHeader S1S2Header; + union + { + float f; + int i; + }SpecBuffer[1502]; +}; +// +// Acquire structure to return for Swir1 Spectrometers +// +struct S1SpecStruct +{ + SpectrumHeader S1SpectrumHeader; + union + { + float f; + int i; + }SpecBuffer[801]; +}; +// +// Acquire structure to return for Swir2 Spectrometers +// +struct S2SpecStruct +{ + SpectrumHeader S2Header; + union + { + float f; + int i; + }SpecBuffer[701]; +}; +// +// Acquire structure to return for Vnir/Swir1 Spectrometers +// +struct VS1SpecStruct +{ + SpectrumHeader VS1Header; + union + { + float f; + int i; + }SpecBuffer[1502]; +}; +// +// Acquire structure to return for Vnir/Swir2 Spectrometers +// +struct VS2SpecStruct +{ + SpectrumHeader VS2Header; + union + { + float f; + int i; + }SpecBuffer[1402]; +}; +// +// Ini struct for the flash +// +struct InitStruct +{ + int Header; //header type used in TCP transfer. + int errbyte; //error code + char name[MAX_PARAMETERS][30]; //space for 200 entries with 30 character names + double value[MAX_PARAMETERS]; //corresponding data values for the 200 entries + int count; //The number of used entries + int verify; //the checksum +}; +// +// Version structure for V Command +// +struct VersionStruct +{ + int Header; //header type used in TCP transfer. + int errbyte; //error code + char version[30]; //30 character version string + double value; //version value + int type; // Type of instrument 1-Vnir, 4-Swir1, 5-Vnir/Swir1 +}; // 8-Siwr2, 9-Vnir/Swir2 +// 12-Swir1/Swir2, 13-Vnir/Swir1/Swir2 +// +// Optimize structure for OPT command +// +struct OptimizeStruct +{ + int Header; //header type used in TCP transfer. + int errbyte; //error code + int itime; //optimized integration time + int gain[2]; //optimized gain for 2 SWIRs + int offset[2]; //optimized offset for 2 SWIRs +}; +// +// Param structure for INIT command +// +struct ParamStruct +{ + int Header; //header type used in TCP transfer. + int errbyte; //error code + char name[30]; //30 character name + double value; //corresponding data values + int count; //number of entries used +}; +// +// Instrument Control Structure for IC command +// +struct InstrumentControlStruct +{ + int Header; //header type used in TCP transfer. + int errbyte; //error code + int detector; //detector value - IC_IT,IC_GAIN,IC_OFFSET,IC_SHUTTER + int cmdType; //detector command + int value; //command value +}; +// +// Header Struct for Restore Command +// +struct HeaderStruct +{ + int Header; // Header value used in TCP transfer + int errbyte; // error code +}; + + + + +struct FRInterpSpecStruct +{ + + SpectrumHeader FRSpectrumHeader; //256 bytes (64 words) + //int arr[761]; + float SpecBuffer[2151]; +}; + + + +#endif diff --git a/othersoft/shuttercali/source_rlx/sensor/logout.cpp b/othersoft/shuttercali/source_rlx/sensor/logout.cpp new file mode 100644 index 0000000..17e444d --- /dev/null +++ b/othersoft/shuttercali/source_rlx/sensor/logout.cpp @@ -0,0 +1,63 @@ +#include "logout.h" +#include "QDebug" +#include "QTextCodec" +QString colorcode = "\033["; +int outputlevel = 4; +logout::logout(QObject *parent) + : QObject(parent) +{ +} + +logout::~logout() +{ +} + +void logout::out(QString str,int level) +{ + if (level>outputlevel) + { + return; + } + QTextCodec *codec = QTextCodec::codecForName("GBK");//޸ + int colorint; + switch (level) + { + case 0: + { + + + break; + } + case 1: + { + + qDebug() << "\033[32m";//ɫ + break; + } + case 2: + { + + qDebug() << "\033[35m";//ɫ + break; + } + case 3: + { + + qDebug() << "\033[31m";//ɫ + break; + } + default: + { + break; + } + } + //str=codec->toUnicode(str.toStdString().c_str()); + qDebug() < + +class logout : public QObject +{ + Q_OBJECT + + + +public: + logout(QObject *parent); + ~logout(); + static void out(QString str, int level=0); + static void setoutlevel(int level = 4); +};