Subversion Repositories group.NITPanels

Rev

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

Rev 16 Rev 19
Line 51... Line 51...
51
            this.led3.On = device.isLedSet(3);
51
            this.led3.On = device.isLedSet(3);
52
            this.led4.On = device.isLedSet(4);
52
            this.led4.On = device.isLedSet(4);
53
            this.led5.On = device.isLedSet(5);
53
            this.led5.On = device.isLedSet(5);
54
            this.led6.On = device.isLedSet(6);
54
            this.led6.On = device.isLedSet(6);
55
            this.led7.On = device.isLedSet(7);
55
            this.led7.On = device.isLedSet(7);
-
 
56
            this.ledPwr.On = device.isLedPwrSet();
56
        }
57
        }
57
 
58
 
58
        private void cmdUpdate_Click(object sender, EventArgs e) {
59
        private void cmdUpdate_Click(object sender, EventArgs e) {
59
            //VolumeControl vc = new VolumeControl();
-
 
60
            //txtVol.Text = Convert.ToString(device.volcontrol.deviceCount);
-
 
61
            device.volcontrol.setDeviceVolume(1, 0.80F);
-
 
62
            txtName.Text = Convert.ToString(device.volcontrol.getDeviceVolume(1));
60
            uint selectAudioDevice = (uint)this.lstAudioDevices.SelectedIndex;
63
 
61
 
-
 
62
            txtAnalog.Text = Convert.ToString(device.analogValue);
-
 
63
            float volume = map_f(device.analogValue, 5, 255, 0.00F, 1.00F);
-
 
64
            txtScalar.Text = Convert.ToString(volume);
-
 
65
            device.volcontrol.setDeviceVolume(selectAudioDevice, volume);
-
 
66
            txtVol.Text = Convert.ToString(device.volcontrol.getDeviceVolume(selectAudioDevice));
-
 
67
            this.device.powerLedStatus = 0;
-
 
68
            this.device.UpdateDisplay();
-
 
69
 
-
 
70
        }
-
 
71
 
-
 
72
        private float map_f(uint x, uint in_min, uint in_max, float out_min, float out_max) {
-
 
73
            float var = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
-
 
74
            return var;
64
        }
75
        }
65
 
76
 
66
        public void setDevice(NITAudioSelDevice audiosel) {
77
        public void setDevice(NITAudioSelDevice audiosel) {
67
            this.device = audiosel;
78
            this.device = audiosel;
68
 
79
 
Line 133... Line 144...
133
        private void led7_Click(object sender, EventArgs e) {
144
        private void led7_Click(object sender, EventArgs e) {
134
            bool status = this.device.isLedSet(7);
145
            bool status = this.device.isLedSet(7);
135
            this.device.setLed(7, !status);
146
            this.device.setLed(7, !status);
136
            this.device.UpdateDisplay();
147
            this.device.UpdateDisplay();
137
        }
148
        }
-
 
149
 
-
 
150
        private void ledPwr_Click(object sender, EventArgs e) {
-
 
151
            bool status = this.device.isLedPwrSet();
-
 
152
            this.device.setLedPwr(!status);
-
 
153
            this.device.UpdateDisplay();
-
 
154
        }
138
    }
155
    }
139
}
156
}