source: BAORadio/libindi/libindi/drivers/filter_wheel/filter_simulator.cpp @ 504

Last change on this file since 504 was 504, checked in by frichard, 13 years ago

-Version 0.8 de libini
-Formule de Marc
-Nouvelles fonctionnalités (goto nom-de l'objet etc...)

File size: 1.9 KB
Line 
1#include "filter_simulator.h"
2
3
4// We declare an auto pointer to FilterSim.
5std::auto_ptr<FilterSim> filter_sim(0);
6
7void ISPoll(void *p);
8
9
10void ISInit()
11{
12   static int isInit =0;
13
14   if (isInit == 1)
15       return;
16
17    isInit = 1;
18    if(filter_sim.get() == 0) filter_sim.reset(new FilterSim());
19    //IEAddTimer(POLLMS, ISPoll, NULL);
20
21}
22
23void ISGetProperties(const char *dev)
24{
25        ISInit();
26        filter_sim->ISGetProperties(dev);
27}
28
29void ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int num)
30{
31        ISInit();
32        filter_sim->ISNewSwitch(dev, name, states, names, num);
33}
34
35void ISNewText( const char *dev, const char *name, char *texts[], char *names[], int num)
36{
37        ISInit();
38        filter_sim->ISNewText(dev, name, texts, names, num);
39}
40
41void ISNewNumber(const char *dev, const char *name, double values[], char *names[], int num)
42{
43        ISInit();
44        filter_sim->ISNewNumber(dev, name, values, names, num);
45}
46
47void ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
48{
49  INDI_UNUSED(dev);
50  INDI_UNUSED(name);
51  INDI_UNUSED(sizes);
52  INDI_UNUSED(blobsizes);
53  INDI_UNUSED(blobs);
54  INDI_UNUSED(formats);
55  INDI_UNUSED(names);
56  INDI_UNUSED(n);
57}
58void ISSnoopDevice (XMLEle *root)
59{
60    INDI_UNUSED(root);
61}
62
63
64FilterSim::FilterSim()
65{
66    //ctor
67}
68
69FilterSim::~FilterSim()
70{
71    //dtor
72}
73
74const char *FilterSim::getDefaultName()
75{
76    return (char *)"Filter Simulator";
77}
78
79bool FilterSim::Connect()
80{
81    CurrentFilter=1;
82    MinFilter=1;
83    MaxFilter=7;
84    return true;
85}
86
87bool FilterSim::Disconnect()
88{
89    return true;
90}
91
92int FilterSim::SelectFilter(int f)
93{
94    CurrentFilter=f;
95    SetTimer(500);
96    return 0;
97}
98
99void FilterSim::TimerHit()
100{
101    SelectFilterDone(CurrentFilter);
102}
Note: See TracBrowser for help on using the repository browser.