public void DataAcquisition() { POSITION_motors(); if (config.ReadCameraStream == true) { CAPTURE_cameraImage(); } else { STOP_streaming(); } if (config.READ_dataFromMotors == true) { if (C_State.FURTHER(e_stateProg.initialized)) { MainWindow.Ms[iReadMotor].READ_positionSpeed(); iReadMotor++; if (iReadMotor >= 3) { iReadMotor = 0; } } } }
private void CancButton_Click(object sender, EventArgs e) { if (IsCubicleOnEdit) { ResetButton.Visible = false; SaveButton.Visible = false; CancButton.Visible = false; IsCubicleOnEdit = false; //ArrowKeys used to resize the cubicle UPArrow.Visible = false; LeftArrow.Visible = false; resetSize.Visible = false; RightArrow.Visible = false; DownArrow.Visible = false; for (int i = 0; i < 6; i++) { l[i].Visible = false; l[i].Dispose(); } C_Name.Dispose(); CubNo.Dispose(); EmpName.Dispose(); EmpSno.Dispose(); C_State.Dispose(); Other.Dispose(); S = -1; } else if (IsResourceOnEdit) { IsResourceOnEdit = false; ResetButton.Visible = false; SaveButton.Visible = false; CancButton.Visible = false; for (int i = 0; i < 7; i++) { l[i].Visible = false; l[i].Dispose(); } AssEmpNo.Dispose(); AssCubNo.Dispose(); ResNo.Dispose(); ResType.Dispose(); ResState.Dispose(); DateOfIssue.Dispose(); OtherInfo.Dispose(); P = -1; } }
public void STOP_streaming() { if (config.cameraControl.StopGrabbing()) { if (C_State.FURTHER(e_stateBaslerCam.initialized)) { C_State.SET_state(e_stateBaslerCam.notStreaming); } } }
public void START_streaming() { if (config.cameraControl.StartGrabbing()) { timeStartedStreaming = DateTime.Now.ToLocalTime(); if (C_State.FURTHER(e_stateBaslerCam.initialized)) { C_State.SET_state(e_stateBaslerCam.streaming); } } }
public void Update_helpText() { HUD.AppendLine("[!]alt|[^]ctrl|[+]shift|[#]super"); HUD.AppendLine(string.Format("Control: [^M]otor={0}|", config.WRITE_dataToMotors)); HUD.AppendLine(string.Format("MotorSpeedControl: [M]{0}", config.motorSpeedControl)); HUD.AppendLine(string.Format("Read: [+M]otor={0}|[+C]amera={1}", config.READ_dataFromMotors, config.ReadCameraStream)); HUD.AppendLine(string.Format("PositionLock: [Tab]={0}|[numbers]={1}:{2}", config.player.PositionLockActive, (int)config.player.PositionLock, config.player.PositionLock )); HUD.AppendLine(string.Format("RoboticArmUpdatingFromAngle: [F5,F6,F7]={0}", ra.angleType )); HUD.AppendLine(string.Format("roboticArmPostureOnCameraCapture: [F8]={0}", config.roboticArmPostureOnCameraCapture )); HUD.AppendLine(""); HUD.AppendLine("CameraArtificialDelay = " + config.cameraArtificialDelay.ToString()); if (config.cameraArtificialDelay == true) { HUD.AppendLine("actual queue frame length = " + queuePixelData.Count().ToString()); HUD.AppendLine("setuped cameraFrameQueueLength = " + config.cameraFrameQueueLength.ToString()); HUD.AppendLine(string.Format("Actual artificial delay = {0,9:F4} [ms]", qAct.TotalMilliseconds)); } HUD.AppendLine(string.Format("Status: [Camera={0}][Motors={1}][SPI={2}]", C_State.baslerCam, C_State.mot, C_State.Spi )); // may be in config constructor string name = "No camera connected - please connect the camera and restart telepresence!"; if (C_State.FURTHER(e_stateBaslerCam.initializing)) { name = config.cameraControl.camera.CameraInfo[Basler.Pylon.CameraInfoKey.DeviceType] + " " + config.cameraControl.camera.CameraInfo[Basler.Pylon.CameraInfoKey.ModelName] ; HUD.AppendLine("Camera: " + name); HUD.AppendLine(string.Format( "Camera: [Connected={0}], [Open={1}], [Grabbing={2}]", config.cameraControl.camera.IsConnected, config.cameraControl.camera.IsOpen, config.cameraControl.camera.StreamGrabber.IsGrabbing )); HUD.AppendLine(string.Format("[U]=[textureConversionAlgorithm={0}]", textureConversionAlgorithm)); HUD.AppendLine(string.Format("[+][-]=[ExposureTime={0:F3}ms]", config.cameraControl.ExposureTime / 1000)); } HUD.AppendLine(""); Vector3 pos; Vector3 rot; pos = config.player.scout.Position; HUD.AppendLine(string.Format("scout [XYZ]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", pos[0], pos[1], pos[2] )); rot = config.player.body.YawPitchRoll; HUD.AppendLine(string.Format("body YawPitchRoll [Yaw|Pitch|Roll]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", rot[0], rot[1], rot[2] )); pos = config.player.hmd.Position; HUD.AppendLine(string.Format("hmd [XYZ]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", pos[0], pos[1], pos[2] )); rot = config.player.hmd.YawPitchRoll; HUD.AppendLine(string.Format("hmd [Yaw|Pitch|Roll]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", rot[0], rot[1], rot[2] )); pos = config.player.Position; HUD.AppendLine(string.Format("Player [XYZ]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", pos[0], pos[1], pos[2] )); rot = config.player.YawPitchRoll; HUD.AppendLine(string.Format("Player [Yaw|Pitch|Roll]: [{0,7:0.00}|{1,7:0.00}|{2,7:0.00}]", rot[0], rot[1], rot[2] )); }