Subversion Repositories group.electronics

Rev

Rev 167 | Rev 171 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 167 Rev 168
Line 11... Line 11...
11
        public Control(Command command) {
11
        public Control(Command command) {
12
            commands.Add(command);
12
            commands.Add(command);
13
        }
13
        }
14
 
14
 
15
        public List<Command> commands = new List<Command>();
15
        public List<Command> commands = new List<Command>();
16
        //public Utils.InputPair data { get; set; }       // The data from the panel
-
 
17
        public jsdata data { get; set; }
16
        public jsdata data { get; set; }
18
        public Boolean updated { get; set; }
17
        public Boolean updated { get; set; }
19
 
18
 
20
        public abstract void Tick();
19
        public abstract void Tick();
21
    }
20
    }
Line 94... Line 93...
94
        public Potentiometer(Command command, int channel) : base(command) {
93
        public Potentiometer(Command command, int channel) : base(command) {
95
            this.channel = channel;
94
            this.channel = channel;
96
        }
95
        }
97
 
96
 
98
        public override void Tick() {
97
        public override void Tick() {
99
            //this.value = data.axis[channel].
-
 
100
            UInt16 tmpval = 0;
98
            UInt16 tmpval = 0;
101
            int changed = data.axis[channel].getPosition(ref tmpval);
99
            bool changed = data.axis[channel].getPosition(ref tmpval);
102
            this.value = tmpval;
100
            this.value = tmpval;
103
            
101
            
104
 
102
 
105
            if (changed == 0) {
103
            if (changed) {
106
                foreach (Command cmd in this.commands) {
104
                foreach (Command cmd in this.commands) {
107
                    cmd.data = this.data;
105
                    cmd.data = this.data;
108
                    if (cmd.Send(this.value) == 0)
106
                    if (cmd.Send(this.value) == 0)
109
                        Console.Write(cmd.ToString());
107
                        Console.Write(cmd.ToString());
110
                }
108
                }