private void cameraSwitch(int button, bool load) { currentlySelectedButton = button; //int camId = CameraRig.idFromButton(button); int camId = CameraRig.idxFromButton(button); if (load || !load && camClick(button)) { if (load || !load && CameraRig.cameraExists(camId)) { selectedWebcam = CameraRig.ConnectedCameras[camId].cameraName; CameraRig.ConfigCam = camId; CameraRig.getCam(camId).MotionDetector.Reset(); camName.Text = (string)CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.friendlyName); drawModeOn.Checked = false; drawModeOff.Checked = true; txtMov.Text = Convert.ToString((double)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.movementVal)) * 100); radioButton4.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.areaDetection)); radioButton3.Checked = !radioButton4.Checked; areaOffAtMotion.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.areaOffAtMotion)); radioButton8.Checked = false; radioButton7.Checked = true; radioButton1.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.areaDetectionWithin)); radioButton2.Checked = !radioButton1.Checked; trkTimeSpike.Value = (int)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.timeSpike)); trkToleranceSpike.Value = (int)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.toleranceSpike)); rdSpikeOn.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, CameraRig.infoEnum.lightSpike)); lblTimeSpike.Text = trkTimeSpike.Value.ToString(); lblToleranceSpike.Text = trkToleranceSpike.Value.ToString() + "%"; cameraWindow.Camera = null; cameraWindow.Camera = CameraRig.getCam(camId); //CameraRig.rig[0].cam; CameraRig.getCam(camId).motionLevelEvent -= new motionLevelEventHandler(drawLevel); CameraRig.getCam(camId).motionLevelEvent += new motionLevelEventHandler(drawLevel); camButtonSetColours(); //camControl(button); } } }
private void cameraSwitch(int button, bool load) { //int camId = CameraRig.idFromButton(button); int camId = CameraRig.idxFromButton(button); if (load || !load && camButtons.camClick(button)) { if (load || !load && CameraRig.cameraExists(camId)) { selectedWebcam = CameraRig.rig[camId].cameraName; CameraRig.drawCam = camId; CameraRig.getCam(camId).MotionDetector.Reset(); camName.Text = (string)CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, "friendlyName"); drawModeOn.Checked = false; drawModeOff.Checked = true; txtMov.Text = Convert.ToString((double)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, "movementVal")) * 100); radioButton4.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, "areaDetection")); radioButton3.Checked = !radioButton4.Checked; areaOffAtMotion.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, "areaOffAtMotion")); radioButton8.Checked = false; radioButton7.Checked = true; radioButton1.Checked = (bool)(CameraRig.rigInfoGet(bubble.profileInUse, selectedWebcam, "areaDetectionWithin")); radioButton2.Checked = !radioButton1.Checked; cameraWindow.Camera = null; cameraWindow.Camera = CameraRig.getCam(camId); //CameraRig.rig[0].cam; CameraRig.getCam(camId).motionLevelEvent -= new motionLevelEventHandler(drawLevel); CameraRig.getCam(camId).motionLevelEvent += new motionLevelEventHandler(drawLevel); camButtonSetColours(); //camControl(button); } } }