Instrument Neutral Distributed Interface INDI  2.0.2
filter_simulator.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2010 Gerry Rozema. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 *******************************************************************************/
18 
19 #include "filter_simulator.h"
20 
21 #include <memory>
22 
23 // We declare an auto pointer to FilterSim.
24 std::unique_ptr<FilterSim> filter_sim(new FilterSim());
25 
27 {
28  return (const char *)"Filter Simulator";
29 }
30 
32 {
33  CurrentFilter = 1;
34  FilterSlotN[0].min = 1;
35  FilterSlotN[0].max = 8;
36  return true;
37 }
38 
40 {
41  return true;
42 }
43 
45 {
46  CurrentFilter = f;
47  SetTimer(500);
48  return true;
49 }
50 
52 {
54 }
The FilterSim class provides a simple simulator to change filters. The filter names are saved to a co...
const char * getDefaultName()
bool Disconnect()
Disconnect from device.
bool SelectFilter(int)
Select a new filter position.
bool Connect()
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
void TimerHit()
Callback function to be called once SetTimer duration elapses.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
void SelectFilterDone(int newpos)
The child class calls this function when the hardware successfully finished selecting a new filter wh...
std::unique_ptr< FilterSim > filter_sim(new FilterSim())