This is the latest working repository used in our demo video for the Maxim to display temperature readings on Bluetooth

Dependencies:   USBDevice

Committer:
darienf
Date:
Sun May 02 23:09:04 2021 +0000
Revision:
5:bc128a16232f
Parent:
3:36de8b9e4b1a
This is the program that was last used, that has the working temperature and some comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
darienf 3:36de8b9e4b1a 1 /*******************************************************************************
darienf 3:36de8b9e4b1a 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All rights Reserved.
darienf 3:36de8b9e4b1a 3 *
darienf 3:36de8b9e4b1a 4 * This software is protected by copyright laws of the United States and
darienf 3:36de8b9e4b1a 5 * of foreign countries. This material may also be protected by patent laws
darienf 3:36de8b9e4b1a 6 * and technology transfer regulations of the United States and of foreign
darienf 3:36de8b9e4b1a 7 * countries. This software is furnished under a license agreement and/or a
darienf 3:36de8b9e4b1a 8 * nondisclosure agreement and may only be used or reproduced in accordance
darienf 3:36de8b9e4b1a 9 * with the terms of those agreements. Dissemination of this information to
darienf 3:36de8b9e4b1a 10 * any party or parties not specified in the license agreement and/or
darienf 3:36de8b9e4b1a 11 * nondisclosure agreement is expressly prohibited.
darienf 3:36de8b9e4b1a 12 *
darienf 3:36de8b9e4b1a 13 * The above copyright notice and this permission notice shall be included
darienf 3:36de8b9e4b1a 14 * in all copies or substantial portions of the Software.
darienf 3:36de8b9e4b1a 15 *
darienf 3:36de8b9e4b1a 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
darienf 3:36de8b9e4b1a 17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
darienf 3:36de8b9e4b1a 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
darienf 3:36de8b9e4b1a 19 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
darienf 3:36de8b9e4b1a 20 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
darienf 3:36de8b9e4b1a 21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
darienf 3:36de8b9e4b1a 22 * OTHER DEALINGS IN THE SOFTWARE.
darienf 3:36de8b9e4b1a 23 *
darienf 3:36de8b9e4b1a 24 * Except as contained in this notice, the name of Maxim Integrated
darienf 3:36de8b9e4b1a 25 * Products, Inc. shall not be used except as stated in the Maxim Integrated
darienf 3:36de8b9e4b1a 26 * Products, Inc. Branding Policy.
darienf 3:36de8b9e4b1a 27 *
darienf 3:36de8b9e4b1a 28 * The mere transfer of this software does not imply any licenses
darienf 3:36de8b9e4b1a 29 * of trade secrets, proprietary technology, copyrights, patents,
darienf 3:36de8b9e4b1a 30 * trademarks, maskwork rights, or any other form of intellectual
darienf 3:36de8b9e4b1a 31 * property whatsoever. Maxim Integrated Products, Inc. retains all
darienf 3:36de8b9e4b1a 32 * ownership rights.
darienf 3:36de8b9e4b1a 33 *******************************************************************************
darienf 3:36de8b9e4b1a 34 */
darienf 3:36de8b9e4b1a 35
darienf 3:36de8b9e4b1a 36 using System;
darienf 3:36de8b9e4b1a 37 using System.Collections.Generic;
darienf 3:36de8b9e4b1a 38 using System.ComponentModel;
darienf 3:36de8b9e4b1a 39 using System.Data;
darienf 3:36de8b9e4b1a 40 using System.Drawing;
darienf 3:36de8b9e4b1a 41 using System.Linq;
darienf 3:36de8b9e4b1a 42 using System.Text;
darienf 3:36de8b9e4b1a 43 using System.Windows.Forms;
darienf 3:36de8b9e4b1a 44
darienf 3:36de8b9e4b1a 45 namespace HealthSensorPlatform
darienf 3:36de8b9e4b1a 46 {
darienf 3:36de8b9e4b1a 47 // Code for ECG Input Mux Tab
darienf 3:36de8b9e4b1a 48 public partial class HspForm
darienf 3:36de8b9e4b1a 49 {
darienf 3:36de8b9e4b1a 50 List<RegisterField> bioZInputMuxField = new List<RegisterField>();
darienf 3:36de8b9e4b1a 51
darienf 3:36de8b9e4b1a 52 // Needed for dynamic changing of options
darienf 3:36de8b9e4b1a 53 RegisterField biozCalFiftyField;
darienf 3:36de8b9e4b1a 54
darienf 3:36de8b9e4b1a 55 void initalizeBioZInputMuxFields()
darienf 3:36de8b9e4b1a 56 {
darienf 3:36de8b9e4b1a 57 string[] enDcloffOptions = { "Disabled*", "ECG Ch.", "BioZ Ch." };
darienf 3:36de8b9e4b1a 58 string[] dcloffIpolOptions = { "P: Pull Up, N: Pull Down*", "P: Pull Down, N: Pull Up" };
darienf 3:36de8b9e4b1a 59 string[] dcloffImagOptions = { "0 nA/Disabled*", "5 nA", "10 nA", "20 nA", "50 nA", "100 nA" };
darienf 3:36de8b9e4b1a 60 string[] dcloffVthOptions = { "VMID ±300 mV*", "VMID ±400 mV", "VMID ±450 mV", "VMID ±500 mV" };
darienf 3:36de8b9e4b1a 61
darienf 3:36de8b9e4b1a 62 string[] bmuxOpenpOptions = { "Connected", "Isolated*" };
darienf 3:36de8b9e4b1a 63 string[] bmuxOpennOptions = { "Connected", "Isolated*" };
darienf 3:36de8b9e4b1a 64
darienf 3:36de8b9e4b1a 65 string[] enRbiasOptions = { "Disabled*", "ECG Bias", "BIOZ Bias" };
darienf 3:36de8b9e4b1a 66 string[] rBiasvOptions = { "50MΩ", "100MΩ*", "200MΩ" };
darienf 3:36de8b9e4b1a 67 string[] rBiaspOptions = { "Disconnected*", "Connected" };
darienf 3:36de8b9e4b1a 68 string[] rBiasnOptions = { "Disconnected*", "Connected" };
darienf 3:36de8b9e4b1a 69
darienf 3:36de8b9e4b1a 70 string[] calEnVcalOptions = { "Disabled*", "Enabled" };
darienf 3:36de8b9e4b1a 71 string[] calVmodeOptions = { "Unipolar*", "Bipolar" };
darienf 3:36de8b9e4b1a 72 string[] calVmagOptions = { "0.25 mV*", "0.50 mV" };
darienf 3:36de8b9e4b1a 73 string[] calFcalOptions = { "FMSTR/128 (~256Hz)", "FMSTR/512 (~64Hz)", "FMSTR/2048 (~16Hz)", "FMSTR/8192 (~4Hz)",
darienf 3:36de8b9e4b1a 74 "FMSTR/2^15 (~1Hz)*", "FMSTR/2^17 (~1/4Hz)", "FMSTR/2^19 (~1/16Hz)", "FMSTR/2^21 (~1/64Hz)" };
darienf 3:36de8b9e4b1a 75 string[] calFiftyOptions = { "Time High", "50%*" };
darienf 3:36de8b9e4b1a 76 string[] calThighOptions = new string[2048/8]; // Assume FMSTR = 32768 Hz
darienf 3:36de8b9e4b1a 77 for (int i = 0; i < 2048/8; i++)
darienf 3:36de8b9e4b1a 78 {
darienf 3:36de8b9e4b1a 79 calThighOptions[i] = (30.52 * i * 8).ToString("F0") + " μs";
darienf 3:36de8b9e4b1a 80 }
darienf 3:36de8b9e4b1a 81 calThighOptions[0] += "*"; // Default
darienf 3:36de8b9e4b1a 82
darienf 3:36de8b9e4b1a 83 string[] calPSelOptions = { "None*", "VMID", "VCALP", "VCALN" };
darienf 3:36de8b9e4b1a 84 string[] calNSelOptions = calPSelOptions;
darienf 3:36de8b9e4b1a 85
darienf 3:36de8b9e4b1a 86 RegisterField enDcloffField = new RegisterField { Name = "\nEN_DCLOFF", Register = 0x10, Index = 12, Width = 2, Descriptions = enDcloffOptions, Label = lblBioZEnDcloff, Control = cboBioZEnDcloff, Device = max30001 };
darienf 3:36de8b9e4b1a 87 RegisterField dcloffIpolField = new RegisterField { Name = "DCLOFF_IPOL", Register = 0x10, Index = 11, Width = 1, Descriptions = dcloffIpolOptions, Label = lblBioZDcloffIpol, Control = cboBioZDcloffIpol, Device = max30001 };
darienf 3:36de8b9e4b1a 88 RegisterField dcloffImagField = new RegisterField { Name = "DCLOFF_IMAG", Register = 0x10, Index = 8, Width = 3, Descriptions = dcloffImagOptions, Label = lblBioZDcloffImag, Control = cboBioZDcloffImag, Device = max30001 };
darienf 3:36de8b9e4b1a 89 RegisterField dcloffVthField = new RegisterField { Name = "DCLOFF_VTH", Register = 0x10, Index = 6, Width = 2, Descriptions = dcloffVthOptions, Label = lblBioZDcloffVth, Control = cboBioZDcloffVth, Device = max30001 };
darienf 3:36de8b9e4b1a 90 bioZInputMuxField.Add(enDcloffField);
darienf 3:36de8b9e4b1a 91 bioZInputMuxField.Add(dcloffIpolField);
darienf 3:36de8b9e4b1a 92 bioZInputMuxField.Add(dcloffImagField);
darienf 3:36de8b9e4b1a 93 bioZInputMuxField.Add(dcloffVthField);
darienf 3:36de8b9e4b1a 94
darienf 3:36de8b9e4b1a 95 RegisterField enUlpLonField = new RegisterField { Name = "\nEN_ULP_LON", Register = 0x10, Index = 22, Width = 2, Descriptions = enDcloffOptions, Label = lblBmuxEnUlpLon, Control = cboBmuxEnUlpLon, Device = max30001 };
darienf 3:36de8b9e4b1a 96 bioZInputMuxField.Add(enUlpLonField);
darienf 3:36de8b9e4b1a 97
darienf 3:36de8b9e4b1a 98 RegisterField bmuxOpenpField = new RegisterField { Name = "BMUX_OPENP", Register = 0x17, Index = 21, Width = 1, Descriptions = bmuxOpenpOptions, Label = lblBioZBmuxOpenp, Control = cboBioZBmuxOpenp, Device = max30001 };
darienf 3:36de8b9e4b1a 99 RegisterField bmuxOpennField = new RegisterField { Name = "BMUX_OPENN", Register = 0x17, Index = 20, Width = 1, Descriptions = bmuxOpennOptions, Label = lblBioZBmuxOpenn, Control = cboBioZBmuxOpenn, Device = max30001 };
darienf 3:36de8b9e4b1a 100 bioZInputMuxField.Add(bmuxOpenpField);
darienf 3:36de8b9e4b1a 101 bioZInputMuxField.Add(bmuxOpennField);
darienf 3:36de8b9e4b1a 102
darienf 3:36de8b9e4b1a 103 RegisterField enRbiasField = new RegisterField { Name = "\nEN_RBIAS", Register = 0x10, Index = 4, Width = 2, Descriptions = enDcloffOptions, Label = lblBioZEnRbias, Control = cboBioZEnRbias, Device = max30001 };
darienf 3:36de8b9e4b1a 104 RegisterField rBiasvField = new RegisterField { Name = "RBIASV", Register = 0x10, Index = 2, Width = 2, Descriptions = rBiasvOptions, Label = lblBioZRbiasv, Control = cboBioZRbiasv, Device = max30001 };
darienf 3:36de8b9e4b1a 105 RegisterField rBiaspField = new RegisterField { Name = "RBIASP", Register = 0x10, Index = 1, Width = 1, Descriptions = rBiaspOptions, Label = lblBioZRbiasp, Control = cboBioZRbiasp, Device = max30001 };
darienf 3:36de8b9e4b1a 106 RegisterField rBiasnField = new RegisterField { Name = "RBIASN", Register = 0x10, Index = 0, Width = 1, Descriptions = rBiasnOptions, Label = lblBioZRbiasn, Control = cboBioZRbiasn, Device = max30001 };
darienf 3:36de8b9e4b1a 107 bioZInputMuxField.Add(enRbiasField);
darienf 3:36de8b9e4b1a 108 bioZInputMuxField.Add(rBiasvField);
darienf 3:36de8b9e4b1a 109 bioZInputMuxField.Add(rBiaspField);
darienf 3:36de8b9e4b1a 110 bioZInputMuxField.Add(rBiasnField);
darienf 3:36de8b9e4b1a 111
darienf 3:36de8b9e4b1a 112 RegisterField calEnVcalField = new RegisterField { Name = "CAL_EN_VCAL", Register = 0x12, Index = 22, Width = 1, Descriptions = calEnVcalOptions, Label = lblBioZCalEnVcal, Control = cboBioZCalEnVcal, Device = max30001 };
darienf 3:36de8b9e4b1a 113 RegisterField calVmodeField = new RegisterField { Name = "CAL_VMODE", Register = 0x12, Index = 21, Width = 1, Descriptions = calVmodeOptions, Label = lblBioZCalVMode, Control = cboBioZCalVMode, Device = max30001 };
darienf 3:36de8b9e4b1a 114 RegisterField calVmagField = new RegisterField { Name = "CAL_VMAG", Register = 0x12, Index = 20, Width = 1, Descriptions = calVmagOptions, Label = lblBioZCalVmag, Control = cboBioZCalVmag, Device = max30001 };
darienf 3:36de8b9e4b1a 115 RegisterField calFcalField = new RegisterField { Name = "CAL_FCAL", Register = 0x12, Index = 12, Width = 3, Descriptions = calFcalOptions, Label = lblBioZCalFcal, Control = cboBioZCalFcal, Device = max30001 };
darienf 3:36de8b9e4b1a 116 biozCalFiftyField = new RegisterField { Name = "CAL_FIFTY", Register = 0x12, Index = 11, Width = 1, Descriptions = calFiftyOptions, Label = lblBioZCalFifty, Control = cboBioZCalFifty, Device = max30001 };
darienf 3:36de8b9e4b1a 117 RegisterField calThighField = new RegisterField { Name = "CAL_THIGH", Register = 0x12, Index = 3, Width = 8, Descriptions = calThighOptions, Label = lblBioZCalThigh, Control = cboBioZCalThigh, Device = max30001 };
darienf 3:36de8b9e4b1a 118 bioZInputMuxField.Add(calEnVcalField);
darienf 3:36de8b9e4b1a 119 bioZInputMuxField.Add(calVmodeField);
darienf 3:36de8b9e4b1a 120 bioZInputMuxField.Add(calVmagField);
darienf 3:36de8b9e4b1a 121 bioZInputMuxField.Add(calFcalField);
darienf 3:36de8b9e4b1a 122 bioZInputMuxField.Add(biozCalFiftyField);
darienf 3:36de8b9e4b1a 123 bioZInputMuxField.Add(calThighField);
darienf 3:36de8b9e4b1a 124
darienf 3:36de8b9e4b1a 125 RegisterField calPSelField = new RegisterField { Name = "BMUX_CALP_SEL", Register = 0x17, Index = 18, Width = 2, Descriptions = calPSelOptions, Label = lblBioZBmuxCalpSel, Control = cboBioZBmuxCalnSel, Device = max30001 };
darienf 3:36de8b9e4b1a 126 RegisterField calNSelField = new RegisterField { Name = "BMUX_CALN_SEL", Register = 0x17, Index = 16, Width = 2, Descriptions = calNSelOptions, Label = lblBioZBmuxCalnSel, Control = cboBioZBmuxCalpSel, Device = max30001 };
darienf 3:36de8b9e4b1a 127 bioZInputMuxField.Add(calPSelField);
darienf 3:36de8b9e4b1a 128 bioZInputMuxField.Add(calNSelField);
darienf 3:36de8b9e4b1a 129 }
darienf 3:36de8b9e4b1a 130
darienf 3:36de8b9e4b1a 131 void BioZInputMuxUpdateRegisters()
darienf 3:36de8b9e4b1a 132 {
darienf 3:36de8b9e4b1a 133 internalUpdate = true;
darienf 3:36de8b9e4b1a 134 ReadComboBoxesRegisters(bioZInputMuxField);
darienf 3:36de8b9e4b1a 135 internalUpdate = false;
darienf 3:36de8b9e4b1a 136 }
darienf 3:36de8b9e4b1a 137
darienf 3:36de8b9e4b1a 138 private void cboBioZCalFifty_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 139 {
darienf 3:36de8b9e4b1a 140 if (cboCalFifty.SelectedIndex == 1)
darienf 3:36de8b9e4b1a 141 {
darienf 3:36de8b9e4b1a 142 cboCalThigh.Enabled = false;
darienf 3:36de8b9e4b1a 143 }
darienf 3:36de8b9e4b1a 144 else
darienf 3:36de8b9e4b1a 145 {
darienf 3:36de8b9e4b1a 146 cboCalThigh.Enabled = true;
darienf 3:36de8b9e4b1a 147 }
darienf 3:36de8b9e4b1a 148 }
darienf 3:36de8b9e4b1a 149
darienf 3:36de8b9e4b1a 150 private void cboBioZEnDcloff_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 151 {
darienf 3:36de8b9e4b1a 152 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 153 }
darienf 3:36de8b9e4b1a 154
darienf 3:36de8b9e4b1a 155
darienf 3:36de8b9e4b1a 156 private void cboBioZDcloffIpol_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 157 {
darienf 3:36de8b9e4b1a 158 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 159 }
darienf 3:36de8b9e4b1a 160
darienf 3:36de8b9e4b1a 161 private void cboBmuxEnUlpLon_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 162 {
darienf 3:36de8b9e4b1a 163 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 164 }
darienf 3:36de8b9e4b1a 165
darienf 3:36de8b9e4b1a 166 private void cboBioZBmuxOpenp_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 167 {
darienf 3:36de8b9e4b1a 168 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 169 }
darienf 3:36de8b9e4b1a 170
darienf 3:36de8b9e4b1a 171 private void cboBioZBmuxOpenn_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 172 {
darienf 3:36de8b9e4b1a 173 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 174 }
darienf 3:36de8b9e4b1a 175
darienf 3:36de8b9e4b1a 176 private void cboBioZEnRbias_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 177 {
darienf 3:36de8b9e4b1a 178 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 179 }
darienf 3:36de8b9e4b1a 180
darienf 3:36de8b9e4b1a 181 private void cboBioZRbiasp_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 182 {
darienf 3:36de8b9e4b1a 183 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 184 }
darienf 3:36de8b9e4b1a 185
darienf 3:36de8b9e4b1a 186 private void cboBioZRbiasn_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 187 {
darienf 3:36de8b9e4b1a 188 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 189 }
darienf 3:36de8b9e4b1a 190
darienf 3:36de8b9e4b1a 191 private void cboBioZBmuxCalpSel_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 192 {
darienf 3:36de8b9e4b1a 193 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 194 }
darienf 3:36de8b9e4b1a 195
darienf 3:36de8b9e4b1a 196 private void cboBioZBmuxCalnSel_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 197 {
darienf 3:36de8b9e4b1a 198 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 199 }
darienf 3:36de8b9e4b1a 200
darienf 3:36de8b9e4b1a 201 private void cboBioZCalEnVcal_SelectedIndexChanged(object sender, EventArgs e)
darienf 3:36de8b9e4b1a 202 {
darienf 3:36de8b9e4b1a 203 redrawBioZMuxImage();
darienf 3:36de8b9e4b1a 204 }
darienf 3:36de8b9e4b1a 205
darienf 3:36de8b9e4b1a 206
darienf 3:36de8b9e4b1a 207 private void redrawBioZMuxImage()
darienf 3:36de8b9e4b1a 208 {
darienf 3:36de8b9e4b1a 209 //Lead Off Check
darienf 3:36de8b9e4b1a 210 if (picLoff1.Image != null)
darienf 3:36de8b9e4b1a 211 picLoff1.Image.Dispose();
darienf 3:36de8b9e4b1a 212 if (picLoff2.Image != null)
darienf 3:36de8b9e4b1a 213 picLoff2.Image.Dispose();
darienf 3:36de8b9e4b1a 214 if (cboBioZEnDcloff.SelectedIndex == 2)
darienf 3:36de8b9e4b1a 215 {
darienf 3:36de8b9e4b1a 216
darienf 3:36de8b9e4b1a 217 if (cboBioZDcloffIpol.SelectedIndex == 0)
darienf 3:36de8b9e4b1a 218 {
darienf 3:36de8b9e4b1a 219 picLoff1.Image = null;
darienf 3:36de8b9e4b1a 220 picLoff2.Image = Properties.Resources.bioz_input_muxloff2;
darienf 3:36de8b9e4b1a 221 }
darienf 3:36de8b9e4b1a 222 else
darienf 3:36de8b9e4b1a 223 {
darienf 3:36de8b9e4b1a 224 picLoff1.Image = Properties.Resources.bioz_input_muxloff1;
darienf 3:36de8b9e4b1a 225 picLoff2.Image = null;
darienf 3:36de8b9e4b1a 226 }
darienf 3:36de8b9e4b1a 227 }
darienf 3:36de8b9e4b1a 228 else
darienf 3:36de8b9e4b1a 229 {
darienf 3:36de8b9e4b1a 230 picLoff1.Image = null;
darienf 3:36de8b9e4b1a 231 picLoff2.Image = null;
darienf 3:36de8b9e4b1a 232 }
darienf 3:36de8b9e4b1a 233
darienf 3:36de8b9e4b1a 234 //Lead On Check Enable
darienf 3:36de8b9e4b1a 235 if (picLeadOn.Image != null)
darienf 3:36de8b9e4b1a 236 picLeadOn.Image.Dispose();
darienf 3:36de8b9e4b1a 237 if (cboBmuxEnUlpLon.SelectedIndex == 2)
darienf 3:36de8b9e4b1a 238 {
darienf 3:36de8b9e4b1a 239 picLeadOn.Image = Properties.Resources.bioz_input_muxlon;
darienf 3:36de8b9e4b1a 240 }
darienf 3:36de8b9e4b1a 241 else
darienf 3:36de8b9e4b1a 242 {
darienf 3:36de8b9e4b1a 243 picLeadOn.Image = null;
darienf 3:36de8b9e4b1a 244 }
darienf 3:36de8b9e4b1a 245
darienf 3:36de8b9e4b1a 246 //Switches
darienf 3:36de8b9e4b1a 247 if (picBioZsw1.Image != null)
darienf 3:36de8b9e4b1a 248 picBioZsw1.Image.Dispose();
darienf 3:36de8b9e4b1a 249 if (picBioZsw2.Image != null)
darienf 3:36de8b9e4b1a 250 picBioZsw2.Image.Dispose();
darienf 3:36de8b9e4b1a 251 if (cboBioZBmuxOpenp.SelectedIndex == 0) //if BIP "Connected"
darienf 3:36de8b9e4b1a 252 {
darienf 3:36de8b9e4b1a 253 picBioZsw1.Image = Properties.Resources.bioz_input_muxsw1;
darienf 3:36de8b9e4b1a 254 }
darienf 3:36de8b9e4b1a 255 else
darienf 3:36de8b9e4b1a 256 {
darienf 3:36de8b9e4b1a 257 picBioZsw1.Image = null;
darienf 3:36de8b9e4b1a 258 }
darienf 3:36de8b9e4b1a 259 if (cboBioZBmuxOpenn.SelectedIndex == 0) //if BIN "Connected"
darienf 3:36de8b9e4b1a 260 {
darienf 3:36de8b9e4b1a 261 picBioZsw2.Image = Properties.Resources.bioz_input_muxsw2;
darienf 3:36de8b9e4b1a 262 }
darienf 3:36de8b9e4b1a 263 else
darienf 3:36de8b9e4b1a 264 {
darienf 3:36de8b9e4b1a 265 picBioZsw2.Image = null;
darienf 3:36de8b9e4b1a 266 }
darienf 3:36de8b9e4b1a 267
darienf 3:36de8b9e4b1a 268 //Lead Bias
darienf 3:36de8b9e4b1a 269 if (picLeadBias1.Image != null)
darienf 3:36de8b9e4b1a 270 picLeadBias1.Image.Dispose();
darienf 3:36de8b9e4b1a 271 if (picLeadBias2.Image != null)
darienf 3:36de8b9e4b1a 272 picLeadBias2.Image.Dispose();
darienf 3:36de8b9e4b1a 273 if (cboBioZEnRbias.SelectedIndex == 2)
darienf 3:36de8b9e4b1a 274 {
darienf 3:36de8b9e4b1a 275 if (cboBioZRbiasp.SelectedIndex == 1)
darienf 3:36de8b9e4b1a 276 {
darienf 3:36de8b9e4b1a 277 picLeadBias1.Image = Properties.Resources.bioz_input_muxlb1;
darienf 3:36de8b9e4b1a 278 }
darienf 3:36de8b9e4b1a 279 else
darienf 3:36de8b9e4b1a 280 {
darienf 3:36de8b9e4b1a 281 picLeadBias1.Image = null;
darienf 3:36de8b9e4b1a 282 }
darienf 3:36de8b9e4b1a 283
darienf 3:36de8b9e4b1a 284 if (cboBioZRbiasn.SelectedIndex == 1)
darienf 3:36de8b9e4b1a 285 {
darienf 3:36de8b9e4b1a 286 picLeadBias2.Image = Properties.Resources.bioz_input_muxlb2;
darienf 3:36de8b9e4b1a 287 }
darienf 3:36de8b9e4b1a 288 else
darienf 3:36de8b9e4b1a 289 {
darienf 3:36de8b9e4b1a 290 picLeadBias2.Image = null;
darienf 3:36de8b9e4b1a 291 }
darienf 3:36de8b9e4b1a 292 }
darienf 3:36de8b9e4b1a 293 else
darienf 3:36de8b9e4b1a 294 {
darienf 3:36de8b9e4b1a 295 picLeadBias1.Image = null;
darienf 3:36de8b9e4b1a 296 picLeadBias2.Image = null;
darienf 3:36de8b9e4b1a 297 }
darienf 3:36de8b9e4b1a 298
darienf 3:36de8b9e4b1a 299 //Calibration
darienf 3:36de8b9e4b1a 300 if (picBioZCal1.Image != null)
darienf 3:36de8b9e4b1a 301 picBioZCal1.Image.Dispose();
darienf 3:36de8b9e4b1a 302 if (picBioZCal2.Image != null)
darienf 3:36de8b9e4b1a 303 picBioZCal2.Image.Dispose();
darienf 3:36de8b9e4b1a 304 if (cboBioZCalEnVcal.SelectedIndex == 1)
darienf 3:36de8b9e4b1a 305 {
darienf 3:36de8b9e4b1a 306 if (cboBioZBmuxCalpSel.SelectedIndex == 1 |
darienf 3:36de8b9e4b1a 307 cboBioZBmuxCalpSel.SelectedIndex == 2 |
darienf 3:36de8b9e4b1a 308 cboBioZBmuxCalpSel.SelectedIndex == 3)
darienf 3:36de8b9e4b1a 309 {
darienf 3:36de8b9e4b1a 310 picBioZCal1.Image = Properties.Resources.bioz_input_muxcal1;
darienf 3:36de8b9e4b1a 311 }
darienf 3:36de8b9e4b1a 312 else
darienf 3:36de8b9e4b1a 313 {
darienf 3:36de8b9e4b1a 314 picBioZCal1.Image = null;
darienf 3:36de8b9e4b1a 315 }
darienf 3:36de8b9e4b1a 316 if (cboBioZBmuxCalnSel.SelectedIndex == 1 |
darienf 3:36de8b9e4b1a 317 cboBioZBmuxCalnSel.SelectedIndex == 2 |
darienf 3:36de8b9e4b1a 318 cboBioZBmuxCalnSel.SelectedIndex == 3)
darienf 3:36de8b9e4b1a 319 {
darienf 3:36de8b9e4b1a 320 picBioZCal2.Image = Properties.Resources.bioz_input_muxcal2;
darienf 3:36de8b9e4b1a 321 }
darienf 3:36de8b9e4b1a 322 else
darienf 3:36de8b9e4b1a 323 {
darienf 3:36de8b9e4b1a 324 picBioZCal2.Image = null;
darienf 3:36de8b9e4b1a 325 }
darienf 3:36de8b9e4b1a 326 }
darienf 3:36de8b9e4b1a 327 else
darienf 3:36de8b9e4b1a 328 {
darienf 3:36de8b9e4b1a 329 picBioZCal1.Image = null;
darienf 3:36de8b9e4b1a 330 picBioZCal2.Image = null;
darienf 3:36de8b9e4b1a 331 }
darienf 3:36de8b9e4b1a 332
darienf 3:36de8b9e4b1a 333
darienf 3:36de8b9e4b1a 334 }
darienf 3:36de8b9e4b1a 335
darienf 3:36de8b9e4b1a 336
darienf 3:36de8b9e4b1a 337 }
darienf 3:36de8b9e4b1a 338 }