Skip to content

Commit

Permalink
NIDAQ: removed all compiler warnings (except for boost).
Browse files Browse the repository at this point in the history
  • Loading branch information
nicost committed Dec 19, 2024
1 parent d07f6e2 commit 601a0db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions DeviceAdapters/NIDAQ/NIDAQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ int NIDAQHub::StartAIMeasuringForPort(NIAnalogInputPort* port)

tThread_ = new TraceMonitoringThread(this);
err = tThread_->Start(GetPhysicalChannelListForMeasuring(physicalAIChannels_), expectedMinVoltsIn_,
expectedMaxVoltsIn_, traceFrequency_, traceAmount_, physicalAIChannels_.size());
expectedMaxVoltsIn_, (float) traceFrequency_, traceAmount_, (int) physicalAIChannels_.size());
}
else
{
Expand Down Expand Up @@ -963,7 +963,7 @@ int NIDAQHub::StopAIMeasuringForPort(NIAnalogInputPort* port)
int err = DEVICE_OK;
if (n > 1)
err = tThread_->Start(GetPhysicalChannelListForMeasuring(physicalAIChannels_), expectedMinVoltsIn_,
expectedMaxVoltsIn_, traceFrequency_, traceAmount_, physicalAIChannels_.size());
expectedMaxVoltsIn_, (float) traceFrequency_, traceAmount_, (int) physicalAIChannels_.size());

return err;
}
Expand Down Expand Up @@ -995,7 +995,7 @@ int NIDAQHub::UpdateAIValues(float64* values, int32 amount)
size_t n = physicalAIChannels_.size();
for (size_t i = 0; i < n; ++i)
{
physicalAIChannels_[i]->UpdateState(values[i]);
physicalAIChannels_[i]->UpdateState((float) values[i]);
}

return DEVICE_OK;
Expand Down Expand Up @@ -1026,7 +1026,7 @@ int NIDAQHub::StartTrace()
delete tThread_;
tThread_ = new TraceMonitoringThread(this);
int err = tThread_->Start(GetPhysicalChannelListForMeasuring(physicalAIChannels_), expectedMinVoltsIn_,
expectedMaxVoltsIn_, traceFrequency_, traceAmount_, physicalAIChannels_.size());
expectedMaxVoltsIn_, (float) traceFrequency_, traceAmount_, (int) physicalAIChannels_.size());

return err;
}
Expand Down Expand Up @@ -1184,7 +1184,7 @@ int NIDAQHub::OnExpectedMaxVoltsIn(MM::PropertyBase* pProp, MM::ActionType eAct)
{
double temp_max = 5.0;
pProp->Get(temp_max);
expectedMaxVoltsIn_ = temp_max;
expectedMaxVoltsIn_ = (float) temp_max;

mThread_->Stop();
mThread_->wait();
Expand All @@ -1208,7 +1208,7 @@ int NIDAQHub::OnExpectedMinVoltsIn(MM::PropertyBase* pProp, MM::ActionType eAct)
{
double temp_min = -5.0;
pProp->Get(temp_min);
expectedMinVoltsIn_ = temp_min;
expectedMinVoltsIn_ = (float) temp_min;

mThread_->Stop();
mThread_->wait();
Expand Down
4 changes: 2 additions & 2 deletions DeviceAdapters/NIDAQ/NIDAQ.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ class NIAnalogInputPort : public CSignalIOBase<NIAnalogInputPort>,

virtual int SetGateOpen(bool open = true) { return SetRunning(open); }
virtual int GetGateOpen(bool& open) { return GetRunning(open); }
virtual int SetSignal(double volts) { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int SetSignal(double) { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int GetSignal(double& volts);
virtual int GetLimits(double& minVolts, double& maxVolts);

virtual int IsDASequenceable(bool& isSequenceable) const { isSequenceable = false; return DEVICE_OK; }
virtual int GetDASequenceMaxLength(long& maxLength) { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int GetDASequenceMaxLength(long&) { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int StartDASequence() { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int StopDASequence() { return DEVICE_UNSUPPORTED_COMMAND; }
virtual int ClearDASequence() { return DEVICE_UNSUPPORTED_COMMAND; }
Expand Down
3 changes: 2 additions & 1 deletion DeviceAdapters/NIDAQ/NIDigitalOutputPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ DigitalOutputPort::DigitalOutputPort(const std::string& port) :
sequenceRunning_(false),
blanking_(false),
blankOnLow_(true),
open_(true),
pos_(0),
numPos_(0),
portWidth_(0),
Expand Down Expand Up @@ -148,7 +149,7 @@ int DigitalOutputPort::Initialize()
CreateProperty(MM::g_Keyword_Closed_Position, "0", MM::Integer, false);
GetGateOpen(open_);

if (supportsBlankingAndSequencing_ && nrOfStateSliders_ >= portWidth_) {
if (supportsBlankingAndSequencing_ && (uint32_t) nrOfStateSliders_ >= portWidth_) {
nrOfStateSliders_ = portWidth_ - 1;
}

Expand Down

0 comments on commit 601a0db

Please sign in to comment.