Switching device properties between read-only and settable

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Switching device properties between read-only and settable

Kyle Douglass

Hi all,

My apologies if this has already been answered, but is it possible to switch a device's property between read-only and being settable based on either user input or the device's state?


For example, say I have a property that let's me turn a laser on and off:


    CPropertyAction* pAct = new CPropertyAction(this, &MPBLaser::OnLDEnable);
    CreateProperty("Switch On/Off", "Off", MM::String, false, pAct);
    std::vector<std::string> commands;
    commands.push_back("Off");
    commands.push_back("On");
    SetAllowedValues("Switch On/Off", commands);


The laser may however only be physically turned on if its hardware security key is engaged. For this reason, I would like to poll the laser if its key is OFF and, if yes, disable setting the "Switch On/Off" property. Unfortunately, I found no such behavior in DeviceBase.h.


Thanks!

Kyle


Dr. Kyle M. Douglass
Post-doctoral Researcher
EPFL - The Laboratory of Experimental Biophysics
http://leb.epfl.ch/
http://kmdouglass.github.io

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: -|EXT|- Switching device properties between read-only and settable

Norman Glasgow

From: Kyle Michael Douglass [mailto:[hidden email]]
Sent: 19 July 2017 14:51

 

Hi all,

My apologies if this has already been answered, but is it possible to switch a device's property between read-only and being settable based on either user input or the device's state?

 

[NG] Not sure, but I’ve managed to do something similar recently.

 

For example, say I have a property that let's me turn a laser on and off:

 

    CPropertyAction* pAct = new CPropertyAction(this, &MPBLaser::OnLDEnable);
    CreateProperty("Switch On/Off", "Off", MM::String, false, pAct);
    std::vector<std::string> commands;
    commands.push_back("Off");
    commands.push_back("On");
    SetAllowedValues("Switch On/Off", commands);

 

The laser may however only be physically turned on if its hardware security key is engaged. For this reason, I would like to poll the laser if its key is OFF and, if yes, disable setting the "Switch On/Off" property. Unfortunately, I found no such behavior in DeviceBase.h.

 

                [NG] The action functor (OnLDEnable) will give you an MM::PropertyBase* pointer. If you cast this to an MM::Property*, you can then set the ReadOnly value.

 

   MM::Property* pChildProperty = (MM::Property*)pProp;

   pChildProperty->SetReadOnly(readOnly);

 

Thanks!

Kyle

 

 

 

Kind Regards,

Norman.

 

 

Click here to report this email as spam.



___________________________________________________________________________
This e-mail is confidential and is for the addressee only.   Please refer to
www.oxinst.com/email-statement for regulatory information.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Karsten Schulz
In reply to this post by Kyle Douglass
Hello together,
 
we want integrate us camerasystems in devicemanager, so we have compiled the DemoCamera Project.
 
Then we have change all the versions ID’s  , but after copy this *.dll to Installfolder of DevMgr we can see the Device is marked as (Unavailable) at HardwareConfigurator.
 
When we replace the original mmgr_dal_DemoCamera.dll  with the own compiled version we take an Exception after Create().
 
Thanks for any information what can help to resolve the problem.
   We use VS2017 and the original DeviceDemo project.
 
 
Thx for any help
  Karsten Schulz


www.FlexxVision.de

Vertreten durch:
Karsten Michael Schulz
Pillnitzer Weg 11
13593 Berlin

Büro/Verwaltung:
+49 (030) 120 102 26

Fax:
+49 (030) 364 044 20

Service:
+49 (0157) 365 623 75

[hidden email]

 
 
 
Sent: Wednesday, July 19, 2017 3:50 PM
Subject: [micro-manager-general] Switching device properties between read-only and settable
 

Hi all,

My apologies if this has already been answered, but is it possible to switch a device's property between read-only and being settable based on either user input or the device's state?

 

For example, say I have a property that let's me turn a laser on and off:

 

    CPropertyAction* pAct = new CPropertyAction(this, &MPBLaser::OnLDEnable);
    CreateProperty("Switch On/Off", "Off", MM::String, false, pAct);
    std::vector<std::string> commands;
    commands.push_back("Off");
    commands.push_back("On");
    SetAllowedValues("Switch On/Off", commands);

 

The laser may however only be physically turned on if its hardware security key is engaged. For this reason, I would like to poll the laser if its key is OFF and, if yes, disable setting the "Switch On/Off" property. Unfortunately, I found no such behavior in DeviceBase.h.

 

Thanks!

Kyle

 

Dr. Kyle M. Douglass
Post-doctoral Researcher
EPFL - The Laboratory of Experimental Biophysics
http://leb.epfl.ch/
http://kmdouglass.github.io


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Nico Stuurman-2
Hi Karsten,

we want integrate us camerasystems in devicemanager, so we have compiled the DemoCamera Project.
 
Then we have change all the versions ID’s  , but after copy this *.dll to Installfolder of DevMgr we can see the Device is marked as (Unavailable) at HardwareConfigurator.
 
When we replace the original mmgr_dal_DemoCamera.dll  with the own compiled version we take an Exception after Create().
 
Thanks for any information what can help to resolve the problem.
   We use VS2017 and the original DeviceDemo project.

Micro-Manager is still build with VS2010.  You can still get this from Microsoft (hopefully still up to date instructions are here: https://micro-manager.org/wiki/Building_MM_on_Windows).  It seems likely that the crash you describe is caused by missing binaries build with different compilers.

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Kyle Douglass

Hi Nico and Karsten,


On 07/19/2017 05:47 PM, Nico Stuurman wrote:
Hi Karsten,

we want integrate us camerasystems in devicemanager, so we have compiled the DemoCamera Project.
 
Then we have change all the versions ID’s  , but after copy this *.dll to Installfolder of DevMgr we can see the Device is marked as (Unavailable) at HardwareConfigurator.
 
When we replace the original mmgr_dal_DemoCamera.dll  with the own compiled version we take an Exception after Create().
 
Thanks for any information what can help to resolve the problem.
   We use VS2017 and the original DeviceDemo project.

Micro-Manager is still build with VS2010.  You can still get this from Microsoft (hopefully still up to date instructions are here: https://micro-manager.org/wiki/Building_MM_on_Windows).  It seems likely that the crash you describe is caused by missing binaries build with different compilers.


I actually checked these instructions and their links two days ago. Unfortunately the StackOverflow link to a VS2010 .iso image is now broken as well, which means there are no working links to an image of VS2010 on the MM wiki. The following official Microsoft link may work, but I haven't tested it since I don't have a Microsoft account: https://www.visualstudio.com/vs/older-downloads/

Cheers,
Kyle

-- 
Kyle M. Douglass, PhD
Post-doctoral researcher
The Laboratory of Experimental Biophysics
EPFL, Lausanne, Switzerland
http://kmdouglass.github.io
http://leb.epfl.ch

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: -|EXT|- Switching device properties between read-only and settable

Kyle Douglass
In reply to this post by Norman Glasgow

Hi Norman,

   [NG] The action functor (OnLDEnable) will give you an MM::PropertyBase* pointer. If you cast this to an MM::Property*, you can then set the ReadOnly value.

   MM::Property* pChildProperty = (MM::Property*)pProp;

   pChildProperty->SetReadOnly(readOnly);


Perfect. Thanks a lot for the help! I'll try this out when I get back to a Windows machine tomorrow.

Kyle
-- 
Kyle M. Douglass, PhD
Post-doctoral researcher
The Laboratory of Experimental Biophysics
EPFL, Lausanne, Switzerland
http://kmdouglass.github.io
http://leb.epfl.ch

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Karsten Schulz
In reply to this post by Nico Stuurman-2
Hello Nico,
 
The Micro-Manager-1.4 like a #define DEVICE_INTERFACE_VERSION 67   (“DriverSDK” i want to integrate customer cameras into devmgr)
 
In my Sources i have a Version 45 Used.  Download was Named : MMDeviceKit-win-x86-x64-Dev45-Mod6a.exe
 
But this is a very old one,  where i can find the Version 67 please ?
 
Thank you  for respons me, and best regards,
  Karsten
  
Sent: Wednesday, July 19, 2017 5:47 PM
Subject: Re: [micro-manager-general] CameraIntegration into DEVMGR & an Series of Unknow Devicees found
 
Hi Karsten,

we want integrate us camerasystems in devicemanager, so we have compiled the DemoCamera Project.
 
Then we have change all the versions ID’s  , but after copy this *.dll to Installfolder of DevMgr we can see the Device is marked as (Unavailable) at HardwareConfigurator.
 
When we replace the original mmgr_dal_DemoCamera.dll  with the own compiled version we take an Exception after Create().
 
Thanks for any information what can help to resolve the problem.
   We use VS2017 and the original DeviceDemo project.

Micro-Manager is still build with VS2010.  You can still get this from Microsoft (hopefully still up to date instructions are here: https://micro-manager.org/wiki/Building_MM_on_Windows).  It seems likely that the crash you describe is caused by missing binaries build with different compilers.

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Nico Stuurman-2
On 7/22/2017 5:27 PM, Karsten Schulz wrote:
The Micro-Manager-1.4 like a #define DEVICE_INTERFACE_VERSION 67   (“DriverSDK” i want to integrate customer cameras into devmgr)
 
In my Sources i have a Version 45 Used.  Download was Named : MMDeviceKit-win-x86-x64-Dev45-Mod6a.exe
 
But this is a very old one,  where i can find the Version 67 please ?

The device kit has been not been used for many, many years.   Instead, see: https://micro-manager.org/wiki/Building_Micro-Manager_Device_Adapters

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CameraIntegration into DEVMGR & an Series of Unknow Devicees found

Karsten Schulz
Hi Nico,
 
after the Odyssee via Version 45 , i have found the solution on : https://github.com/micro-manager/micro-manager/
 
Now we have succseed the first KameraDevice for MM  compiled with VisualStudio 2017 and the old SDK 7.1a .
And its works so far .
 
Very thanks for your Helpness
  Best regards Karsten
 

www.FlexxVision.de

Vertreten durch:
Karsten Michael Schulz
Pillnitzer Weg 11
13593 Berlin

Büro/Verwaltung:
+49 (030) 120 102 26
Fax:
+49 (030) 364 044 20
Service:
+49 (0157) 365 623 75

[hidden email]

  
 
 
Sent: Sunday, July 23, 2017 9:55 PM
Subject: Re: [micro-manager-general] CameraIntegration into DEVMGR & an Series of Unknow Devicees found
 
On 7/22/2017 5:27 PM, Karsten Schulz wrote:
The Micro-Manager-1.4 like a #define DEVICE_INTERFACE_VERSION 67   (“DriverSDK” i want to integrate customer cameras into devmgr)
 
In my Sources i have a Version 45 Used.  Download was Named : MMDeviceKit-win-x86-x64-Dev45-Mod6a.exe
 
But this is a very old one,  where i can find the Version 67 please ?

The device kit has been not been used for many, many years.   Instead, see: https://micro-manager.org/wiki/Building_Micro-Manager_Device_Adapters

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...