Subversion Repositories group.electronics

Rev

Rev 170 | Go to most recent revision | 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>();
24
 
160 pfowler 25
        private Boolean enabled;
26
        public Boolean Enabled {
27
            get {
28
                return enabled;
29
            }
30
            set {
161 pfowler 31
                this.enabled = value;
160 pfowler 32
            }
33
        }
34
 
161 pfowler 35
        public Panel(mcp2221 mcp) {
160 pfowler 36
            this.mcp = mcp;
161 pfowler 37
            this.mcp.usbi2c.Settings.GetConnectionStatus();
160 pfowler 38
            this.id = this.mcp.usbi2c.Management.GetSelectedDevNum();
39
            this.name = this.mcp.usbi2c.Settings.GetUsbStringDescriptor();
161 pfowler 40
 
160 pfowler 41
        }
42
 
43
        public virtual int Init() {
44
 
45
 
46
            return 1;
47
        }
48
        public abstract int Refresh();
49
        public abstract int Input();
161 pfowler 50
 
51
        public void addControl(Control control) {
52
            this.controls.Add(control);
53
        }
160 pfowler 54
    }
55
}