public async Task <IActionResult> Post() { long camerasCount = 0; // The Random number is because we have two partitions and // we are simply going to randomize the requests. Random rnd = new Random(); try { // This is the partition logic required to access // the partitioned StatefulService in the back-end. long randomNumber = rnd.Next(0, 2); Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partKey = new Microsoft.ServiceFabric.Services.Client.ServicePartitionKey(randomNumber); ICameras cameras = ServiceProxy.Create <ICameras>(backEndServiceUri, partKey, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector.Default, null); camerasCount = await cameras.AddCameraAsync(); } catch (Exception exc) { System.Diagnostics.Trace.WriteLine(String.Format("Error: {0}", exc.Message)); } System.Diagnostics.Trace.WriteLine(String.Format(" Camera Count: {0}", camerasCount)); return(this.Ok(String.Format("Count: {0}", camerasCount.ToString()))); }
private void RearNamingRejct() { this.rRejectServoMotors = this.rearReject.ServoMoters; this.rRejectSensors = this.rearReject.Sensors; this.rRejectCylinders = this.rearReject.Cylinders; this.rRejectCameras = this.rearReject.Cameras; this.rRejectFlashLights = this.rearReject.FlashLights; //STC-CLC500A, 4096/2048, 3.45um, 8bit bayer //Hardening Check rRejectCamera = rRejectCameras[0]; //카메라 촬영 시 사용되는 플레쉬 조명 //JFLLS-100, 포트:1번 RejectFlashLight = rRejectFlashLights[0]; //Reject Y Axis HF-KP13 100w Axis4 = rRejectServoMotors[0]; //Reject X Axis HF-KP13 100w Axis5 = rRejectServoMotors[1]; //Cylinder : Z Axis Y01A = rRejectCylinders[0]; //Cylinder : Gripper Y01B = rRejectCylinders[1]; //Cylinder : Z Axis : Sensor : Up X038 = rRejectSensors[0]; //Cylinder : Z Axis : Sensor : Down X039 = rRejectSensors[1]; //Cylinder : Gripper : Sensor Up X03A = rRejectSensors[2]; //Cylinder : Gripper : Sensor Down X03B = rRejectSensors[3]; }
public async Task <IEnumerable <string> > Get() { long camerasCount = 0; try { Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partKey = new Microsoft.ServiceFabric.Services.Client.ServicePartitionKey(0); ICameras cameras = ServiceProxy.Create <ICameras>(backEndServiceUri, partKey, Microsoft.ServiceFabric.Services.Communication.Client.TargetReplicaSelector.Default, null); camerasCount = await cameras.GetCamerasCountAsync(); } catch (Exception exc) { System.Diagnostics.Trace.WriteLine(String.Format("Error: {0}", exc.Message)); } System.Diagnostics.Trace.WriteLine(String.Format(" Camera Count: {0}", camerasCount)); return(new string[] { camerasCount.ToString() }); }
public Services(IBackend backend, IDisplay display, IFps fps, IStages stages, IInput input, ISurfaces surfaces, ICameras cameras, IFonts fonts, IHelpers helpers) { Backend = backend; Display = display; FPS = fps; Stages = stages; Input = input; Surfaces = surfaces; Cameras = cameras; Fonts = fonts; Helpers = helpers; }
public CoordinateTransformsTest() { _windowResolution = new Vector2(960.0f, 540.0f); var window = Substitute.For <IWindow>(); window.Width.Returns((uint)_windowResolution.X); window.Height.Returns((uint)_windowResolution.Y); var components = Substitute.For <ISystemComponents>(); components.Window.Returns(window); var messenger = Substitute.For <IFrameworkMessenger>(); var cameraFactory = new CameraFactory(components); var idGenerator = new IdGenerator(messenger); var collectionFactory = new SimpleDictionaryCollectionFactory(messenger); var cameraManager = new CameraManager(cameraFactory, idGenerator, collectionFactory); var viewportFactory = new ViewportFactory(); _viewportManager = new ViewportManager(viewportFactory, idGenerator, collectionFactory); _transforms = new CoordinateTransforms(components, cameraManager, _viewportManager); _cameras = new Cameras(cameraManager); }