Skip to content

Commit

Permalink
Merge branch 'pr' of https://github.com/samdrea/mmCoreAndDevices into pr
Browse files Browse the repository at this point in the history
  • Loading branch information
samdrea committed Sep 23, 2024
2 parents 50be5ca + 42000b5 commit 9485c87
Show file tree
Hide file tree
Showing 18 changed files with 2,209 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-mmdevice-mmcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runner: windows-2019
cxx: cl
- os: macos
runner: macos-11
runner: macos-12
cxx: clang++
- os: ubuntu
runner: ubuntu-22.04
Expand Down
60 changes: 59 additions & 1 deletion DeviceAdapters/ASITiger/ASIScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,15 @@ int CScanner::Initialize()
UpdateProperty(g_SPIMScanDurationPropertyName);
}

if (FirmwareVersionAtLeast(3.14)) {
// in 3.50 added bit 7 of SPIM mode for smooth slice (e.g. constant galvo scan for scope)
pAct = new CPropertyAction (this, &CScanner::OnSPIMSmoothSliceEnable);
CreateProperty(g_SPIMSmoothSliceEnable, g_NoState, MM::String, false, pAct);
AddAllowedValue(g_SPIMSmoothSliceEnable, g_YesState);
AddAllowedValue(g_SPIMSmoothSliceEnable, g_NoState);
UpdateProperty(g_SPIMSmoothSliceEnable);
}

} // adding SPIM properties

// add ring buffer properties if supported (starting 2.81)
Expand Down Expand Up @@ -3251,7 +3260,7 @@ int CScanner::OnSPIMAlternateDirectionsEnable(MM::PropertyBase* pProp, MM::Actio
RETURN_ON_MM_ERROR( hub_->QueryCommandVerify(command.str(), ":A Z="));
RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(tmp) );
tmp = tmp >> 5; // shift left to get bits 5 in position of LSB
tmp &= (0x01); // mask off all but what used to be bit 4
tmp &= (0x01); // mask off all but what used to be bit 5
switch (tmp)
{
case 0: success = pProp->Set(g_NoState); break;
Expand Down Expand Up @@ -3287,6 +3296,55 @@ int CScanner::OnSPIMAlternateDirectionsEnable(MM::PropertyBase* pProp, MM::Actio
return DEVICE_OK;
}

int CScanner::OnSPIMSmoothSliceEnable(MM::PropertyBase* pProp, MM::ActionType eAct)
{
ostringstream command; command.str("");
long tmp = 0;
bool success;
if (eAct == MM::BeforeGet)
{
if (!refreshProps_ && initialized_)
return DEVICE_OK;
command << addressChar_ << "NR Z?";
RETURN_ON_MM_ERROR( hub_->QueryCommandVerify(command.str(), ":A Z="));
RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(tmp) );
tmp = tmp >> 7; // shift left to get bits 7 in position of LSB
tmp &= (0x01); // mask off all but what used to be bit 7
switch (tmp)
{
case 0: success = pProp->Set(g_NoState); break;
case 1: success = pProp->Set(g_YesState); break;
default: success = 0;
}
if (!success)
return DEVICE_INVALID_PROPERTY_VALUE;
}
else if (eAct == MM::AfterSet) {
if (hub_->UpdatingSharedProperties())
return DEVICE_OK;
string tmpstr;
pProp->Get(tmpstr);
if (tmpstr.compare(g_NoState) == 0)
tmp = 0;
else if (tmpstr.compare(g_YesState) == 0)
tmp = 1;
else
return DEVICE_INVALID_PROPERTY_VALUE;
tmp = tmp << 7; // right shift to get the value to bit 7
command << addressChar_ << "NR Z?";
long tmp2;
RETURN_ON_MM_ERROR( hub_->QueryCommandVerify(command.str(), ":A Z="));
RETURN_ON_MM_ERROR ( hub_->ParseAnswerAfterEquals(tmp2) );
tmp += (tmp2 & (0x7F)); // keep bit 7 from tmp, all others use current setting
if (tmp == tmp2)
return DEVICE_OK; // don't need to set value if it's already correct
command.str(""); command << addressChar_ << "NR Z=" << tmp;
RETURN_ON_MM_ERROR ( hub_->QueryCommandVerify(command.str(), ":A") );
RETURN_ON_MM_ERROR ( hub_->UpdateSharedProperties(addressChar_, pProp->GetName(), tmpstr.c_str()) );
}
return DEVICE_OK;
}

int CScanner::OnSPIMModeByte(MM::PropertyBase* pProp, MM::ActionType eAct)
{
ostringstream command; command.str("");
Expand Down
1 change: 1 addition & 0 deletions DeviceAdapters/ASITiger/ASIScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class CScanner : public ASIPeripheralBase<CGalvoBase, CScanner>
int OnSPIMPiezoHomeDisable (MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMInterleaveSidesEnable(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMAlternateDirectionsEnable(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMSmoothSliceEnable(MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMModeByte (MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMNumRepeats (MM::PropertyBase* pProp, MM::ActionType eAct);
int OnSPIMState (MM::PropertyBase* pProp, MM::ActionType eAct);
Expand Down
1 change: 1 addition & 0 deletions DeviceAdapters/ASITiger/ASITiger.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ const char* const g_SPIMPiezoHomeDisable = "SPIMPiezoHomeDisable";
const char* const g_SPIMScannerHomeDisable = "SPIMScannerHomeDisable";
const char* const g_SPIMInterleaveSidesEnable = "SPIMInterleaveSidesEnable";
const char* const g_SPIMAlternateDirectionsEnable = "SPIMAlternateDirectionsEnable";
const char* const g_SPIMSmoothSliceEnable = "SPIMSmoothSliceEnable";
const char* const g_SPIMNumRepeatsPropertyName = "SPIMNumRepeats";
const char* const g_SPIMArmForTTLPropertyName = "SPIMArm";
const char* const g_SPIMStatePropertyName = "SPIMState";
Expand Down
22 changes: 18 additions & 4 deletions DeviceAdapters/OpenFlexure/OpenFlexure.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// FILE: OpenFlexure.cpp
// PROJECT: Micro-Manager
// SUBSYSTEM: DeviceAdapters
//-----------------------------------------------------------------------------
// DESCRIPTION: Adapter for the OpenFlexure Microscope. This adapter is used on the v5 Sangaboard.
// DESCRIPTION: Adapter for the OpenFlexure Microscope. This adapter is used on the v5 Sangaboard.
//
// AUTHOR: Samdrea Hsu, [email protected], 06/22/2024
//
// Karl Hoover (stuff such as programmable CCD size & the various image processors)
// Arther Edelstein ( equipment error simulation)
//
// COPYRIGHT: Samdrea Hsu
//
// AUTHOR: Samdrea Hsu, [email protected], 06/22/2024
// LICENSE: This file is distributed under the BSD license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -951,4 +965,4 @@ int LEDIllumination::SetBrightness()
pHub->SendCommand(cmd, _serial_answer);

return DEVICE_OK;
}
}
20 changes: 17 additions & 3 deletions DeviceAdapters/OpenFlexure/OpenFlexure.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// FILE: OpenFlexure.h
// PROJECT: Micro-Manager
// SUBSYSTEM: DeviceAdapters
//-----------------------------------------------------------------------------
// DESCRIPTION: Adapter for the OpenFlexure Microscope. This adapter is used on the v5 Sangaboard.
// DESCRIPTION: Adapter for the OpenFlexure Microscope. This adapter is used on the v5 Sangaboard.
//
// AUTHOR: Samdrea Hsu, [email protected], 06/22/2024
//
// Karl Hoover (stuff such as programmable CCD size & the various image processors)
// Arther Edelstein ( equipment error simulation)
//
// COPYRIGHT: Samdrea Hsu
//
// AUTHOR: Samdrea Hsu, [email protected], 06/22/2024
// LICENSE: This file is distributed under the BSD license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
//////////////////////////////////////////////////////////////////////////////

Expand Down
8 changes: 1 addition & 7 deletions DeviceAdapters/OpenFlexure/OpenFlexure.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetDir)$(TargetName).dll" "C:\Program Files\Micro-Manager-2.0\$(TargetName).dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand All @@ -165,11 +162,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetDir)$(TargetName).dll" "C:\Program Files\Micro-Manager-2.0\$(TargetName).dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
Loading

0 comments on commit 9485c87

Please sign in to comment.