Subversion Repositories group.electronics

Rev

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

Rev 167 Rev 168
Line 16... Line 16...
16
 
16
 
17
        public jsaxis() {
17
        public jsaxis() {
18
 
18
 
19
        }
19
        }
20
 
20
 
21
        public int getPosition(ref UInt16 position) {
21
        public bool getPosition(ref UInt16 position) {
22
            if (this.value > this.max)
22
            if (this.value > this.max)
23
                this.max = this.value;
23
                this.max = this.value;
24
 
24
 
25
            UInt16 lowerval = 0;
25
            UInt16 lowerval = 0;
26
            if (this.prev >= this.thres)
26
            if (this.prev >= this.thres)
Line 38... Line 38...
38
                    this.value = this.max;
38
                    this.value = this.max;
39
 
39
 
40
                this.prev = this.value;
40
                this.prev = this.value;
41
 
41
 
42
                position = Globals.map_uint16(this.value, 0, this.max, 0, this.mapsize);
42
                position = Globals.map_uint16(this.value, 0, this.max, 0, this.mapsize);
43
                return 1;
43
                return true;
44
                //Globals.bios.SendData("ALCP_RCVR_LTS " + refuellight.ToString() + "\n");
44
                //Globals.bios.SendData("ALCP_RCVR_LTS " + refuellight.ToString() + "\n");
45
                //Console.WriteLine("ALCP_RCVR_LTS " + ":" + refuellight.ToString() + "(" + devices[devid].cur_adc + ")");
45
                //Console.WriteLine("ALCP_RCVR_LTS " + ":" + refuellight.ToString() + "(" + devices[devid].cur_adc + ")");
46
            } else {
46
            } else {
47
                position = 0;
47
                position = 0;
48
                return 1;
48
                return false;
49
            }
49
            }
50
        }
50
        }
51
 
51
 
52
 
52
 
53
    }
53
    }
Line 74... Line 74...
74
        public String name { get; set; }
74
        public String name { get; set; }
75
        public String serialno { get; set; }
75
        public String serialno { get; set; }
76
 
76
 
77
        public List<Control> controls = new List<Control>();
77
        public List<Control> controls = new List<Control>();
78
 
78
 
79
        //public Boolean inputChanged { get; set; }
-
 
80
 
-
 
81
 
-
 
82
        private Boolean enabled;
79
        private Boolean enabled;
83
        public Boolean Enabled {
80
        public Boolean Enabled {
84
            get {
81
            get {
85
                return enabled;
82
                return enabled;
86
            }
83
            }
Line 115... Line 112...
115
        }
112
        }
116
    }
113
    }
117
 
114
 
118
 
115
 
119
    public class Panel_AHFS : Panel {
116
    public class Panel_AHFS : Panel {
120
        //Utils.InputPair switchInput;
-
 
121
        //Utils.InputPair adcInput;
-
 
122
 
-
 
123
        //public uint adc_max;
-
 
124
        //public uint adc_threshold;
-
 
125
 
117
 
126
        private mcp23017[] chips;
118
        private mcp23017[] chips;
127
 
119
 
128
        public Panel_AHFS(mcp2221 mcp) : base(mcp) {
120
        public Panel_AHFS(mcp2221 mcp) : base(mcp) {
129
            chips = new mcp23017[2] { new mcp23017(mcp, 0x20), new mcp23017(mcp, 0x21) };
121
            chips = new mcp23017[2] { new mcp23017(mcp, 0x20), new mcp23017(mcp, 0x21) };
Line 150... Line 142...
150
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_HUD_MODE"), 15));       // Stby - Norm
142
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_HUD_MODE"), 15));       // Stby - Norm
151
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_CICU"), 3));            // Off - On
143
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_CICU"), 3));            // Off - On
152
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_JTRS"), 4));            // Off - On
144
            this.addControl(new Switch2Pos(new CommandDCS("AHCP_JTRS"), 4));            // Off - On
153
            this.addControl(new Switch3Pos(new CommandDCS("AHCP_IFFCC"), 6, 5));        // Off - Test - On
145
            this.addControl(new Switch3Pos(new CommandDCS("AHCP_IFFCC"), 6, 5));        // Off - Test - On
154
            this.addControl(new Switch2Pos(new CommandDCS("HARS_FAST_ERECT"), 7));      // Off - On
146
            this.addControl(new Switch2Pos(new CommandDCS("HARS_FAST_ERECT"), 7));      // Off - On
155
            //this.addControl(new Switch2Pos(new CommandTrackIRKey(VirtualKeyCode.F9), 7));
-
 
156
            this.addControl(new Potentiometer(new CommandDCS("ALCP_RCVR_LTS"), 0));     // 0x00 - 0xFFFF
147
            this.addControl(new Potentiometer(new CommandDCS("ALCP_RCVR_LTS"), 0));     // 0x00 - 0xFFFF
157
            
148
            
158
            // Fuel System
149
            // Fuel System
159
            this.addControl(new Switch2Pos(new CommandDCS("FSCP_AMPL"), 16));
150
            this.addControl(new Switch2Pos(new CommandDCS("FSCP_AMPL"), 16));
160
            this.addControl(new Switch2Pos(new CommandDCS("FSCP_BOOST_MAIN_L"), 24));
151
            this.addControl(new Switch2Pos(new CommandDCS("FSCP_BOOST_MAIN_L"), 24));