/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="result"></param> private void memePeripheralConnected(object sender, MEMEStatus result) { if (result == MEMEStatus.MEMELIB_OK) { this.isConnectedPeripheral = true; this.SetConnectionStatus("Status : Connected"); this.SetTextColor(0x04, "Disconnect", Color.White, Color.Red); this.SetTextColor(0x05, "Start Measurement", Color.White, Color.Red); this.fwVersion = this.memeLib.getFWVersion(); this.deviceVersionLabel.Text = this.fwVersion; this.sdkVersion = this.memeLib.getSDKVersion(); this.SDKVersionLabel.Text = this.sdkVersion; this.hwVersion = this.memeLib.getHWVersion(); this.mode = this.memeLib.getMode(); this.quality = this.memeLib.getQuality(); this.accelRange = this.memeLib.getAccelRange(); this.gyroRange = this.memeLib.getGyroRange(); } else if (result == MEMEStatus.MEMELIB_TIMEOUT) { this.isConnectedPeripheral = false; this.SetConnectionStatus("Status : Disonnected"); this.SetTextColor(0x04, "Connect", Color.White, Color.Red); this.SetTextColor(0x05, "Start Measurement", Color.Black, Color.LightGray); } }
/// <summary> /// bt_StartMeasurement_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bt_StartMeasurement_Click(object sender, EventArgs e) { if (isStartMeasurement == false) { this.accelRange = (MEMEAccelRange)cb_AccRange.SelectedIndex; this.memeLib.setAccelRange(this.accelRange); this.gyroRange = (MEMEGyroRange)cb_GyroRange.SelectedIndex; this.memeLib.setGyroRange(this.gyroRange); this.isFreeMarking = false; this.memeLib.startDataReport(); this.isStartMeasurement = true; this.SetTextColor(0x05, "Stop Measurement", Color.White, Color.Red); this.saveCsvHeader(); } else { this.memeLib.stopDataReport(); this.isStartMeasurement = false; this.SetTextColor(0x05, "Start Measurement", Color.White, Color.Red); } }