Subversion Repositories group.electronics

Rev

Rev 171 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
160 pfowler 1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
162 pfowler 6
using WindowsInput.Native;
160 pfowler 7
 
8
namespace nitdcscore {
167 pfowler 9
 
160 pfowler 10
    public interface IPanel {
11
        int Init();
12
        int Refresh();
13
        int Input();
14
    }
15
 
16
    public abstract class Panel : IPanel {
167 pfowler 17
        public jsdata data = new jsdata();
160 pfowler 18
        protected mcp2221 mcp;
19
        public int id { get; set; }
20
        public String name { get; set; }
21
        public String serialno { get; set; }
22
 
161 pfowler 23
        public List<Control> controls = new List<Control>();
172 pfowler 24
        public List<Led> leds = new List<Led>();
161 pfowler 25
 
160 pfowler 26
        private Boolean enabled;
27
        public Boolean Enabled {
28
            get {
29
                return enabled;
30
            }
31
            set {
161 pfowler 32
                this.enabled = value;
160 pfowler 33
            }
34
        }
35
 
161 pfowler 36
        public Panel(mcp2221 mcp) {
160 pfowler 37
            this.mcp = mcp;
161 pfowler 38
            this.mcp.usbi2c.Settings.GetConnectionStatus();
160 pfowler 39
            this.id = this.mcp.usbi2c.Management.GetSelectedDevNum();
40
            this.name = this.mcp.usbi2c.Settings.GetUsbStringDescriptor();
161 pfowler 41
 
160 pfowler 42
        }
43
 
44
        public virtual int Init() {
45
 
46
 
47
            return 1;
48
        }
49
        public abstract int Refresh();
50
        public abstract int Input();
161 pfowler 51
 
172 pfowler 52
        public void addLed(Led led) {
53
            this.leds.Add(led);
54
        }
55
 
161 pfowler 56
        public void addControl(Control control) {
57
            this.controls.Add(control);
58
        }
160 pfowler 59
    }
60
}