1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Motor record question |
From: | Kevin Peterson <[email protected]> |
To: | 'Jörn Dreyer' <[email protected]> |
Cc: | "'[email protected]'" <[email protected]> |
Date: | Mon, 23 Jul 2018 09:50:01 -0500 |
The PIGCS2 support uses this approach.CreateGCSController creates an instance of the appropriate class of controller based on the controller's version string:
https://github.com/epics-modules/motor/blob/3683d3f0eaae1b5893cd32615174b646cf259581/motorApp/PIGCS2Src/PIGCSController.cpp#L42 Kevin On 07/23/2018 09:29 AM, Mark Rivers wrote:
Hi Jörn, Perhaps what you are asking is if you can define multiple classes: - Stepper with encoder - Stepper without encoder - Piezo with encoder - Piezo without encoder I think you should be able to do that using inheritance. You could create a base axis class that your controller class knows about, but then have the actual axis objects based on derived classes that implement the different types. Mark