public GensetMotorStatus GetGensetMotorStatus(PumpInfo userIdPumpId) { var pumpInfo = userIdPumpId; if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.Headers.Add("Cache-Control", "no-cache"); } var businnessLayer = new APIBusinessLayer(); return(businnessLayer.GetGensetMotorStatus(pumpInfo.UserId, pumpInfo.PumpId)); }
public void Pipette(byte armID, byte pumpID, int volumeUL, int ulPerSecond, bool bAspirate) { const int maxStepsPerSecond = 1000; const int minStepsPerSecond = 50; PumpInfo pumpInfo = Configurations.Instance.ArmsInfo[armID].PumpsInfo[pumpID]; int syringeVolumeUL = pumpInfo.SyringeVolumeUL; double maxULPerSecond = CalculateSpeed(maxStepsPerSecond, pumpInfo.TotalMotorSteps, pumpInfo.SyringeVolumeUL); double minULPerSecond = CalculateSpeed(minStepsPerSecond, pumpInfo.TotalMotorSteps, pumpInfo.SyringeVolumeUL); if (ulPerSecond > maxULPerSecond || ulPerSecond < minULPerSecond) { string pipetteDesc = bAspirate ? "aspirate" : "dispense"; throw new ArgumentOutOfRangeException(string.Format("{0} must between {1} and {2}!", ulPerSecond, minULPerSecond, maxULPerSecond)); } }
public void loadMap() { for (int x = 0; x < 20; x++) { for (int z = 0; z < 20; z++) { gridInfo[x, z] = 0; placeItemInfo[x, z] = 0; } } Vector2 prev = gridTurningPoints[0]; for (int i = 1; i < gridTurningPoints.Count; i++) { loadRoute(prev, gridTurningPoints[i]); prev = gridTurningPoints[i]; } //Detect the palce of all turbines, pumps and transformers that already in the scene GameObject[] allTurbines = GameObject.FindGameObjectsWithTag("turbine"); GameObject[] allPumps = GameObject.FindGameObjectsWithTag("waterTower"); GameObject[] allTransformers = GameObject.FindGameObjectsWithTag("transformer"); GameObject[] allTransformerForTurbines = GameObject.FindGameObjectsWithTag("transformerForTurbine"); for (int i = 0; i < allTurbines.Length; i++) { Transform currentTransform = allTurbines[i].transform; Vector2 gridPlace = TerrainInfo.TransformToGrid(currentTransform.position); TurbineInfo currentTurbine = allTurbines[i].transform.GetComponent <TurbineInfo>(); currentTurbine.x = (int)gridPlace.x; currentTurbine.z = (int)gridPlace.y; placeItemInfo[(int)gridPlace.x, (int)gridPlace.y] = 1; } for (int i = 0; i < allPumps.Length; i++) { Transform currentTransform = allPumps[i].transform; Vector2 gridPlace = TerrainInfo.TransformToGrid(currentTransform.position); PumpInfo currentPump = allPumps[i].transform.GetComponent <PumpInfo>(); currentPump.x = (int)gridPlace.x; currentPump.z = (int)gridPlace.y; placeItemInfo[(int)gridPlace.x, (int)gridPlace.y] = 1; } for (int i = 0; i < allTransformers.Length; i++) { Transform currentTransform = allTransformers[i].transform; Vector2 gridPlace = TerrainInfo.TransformToGrid(currentTransform.position); TransformerInfo currentTransformer = allTransformers[i].transform.GetComponent <TransformerInfo>(); currentTransformer.x = (int)gridPlace.x; currentTransformer.z = (int)gridPlace.y; placeItemInfo[(int)gridPlace.x, (int)gridPlace.y] = 1; } for (int i = 0; i < allTransformerForTurbines.Length; i++) { Transform currentTransform = allTransformerForTurbines[i].transform; Vector2 gridPlace = TerrainInfo.TransformToGrid(currentTransform.position); TransformerForTurbineInfo currentTransformerForTurbine = allTransformerForTurbines[i].transform.GetComponent <TransformerForTurbineInfo>(); currentTransformerForTurbine.x = (int)gridPlace.x; currentTransformerForTurbine.z = (int)gridPlace.y; placeItemInfo[(int)gridPlace.x, (int)gridPlace.y] = 1; } }