Example #1
0
        public void Rotate(RotationInfo rotationInfo)
        {
            var rotation = rotationFactory.CreateRotation(rotationInfo);

            rotation.Apply(this);

            OnMoving(new UIRotation(rotation));
        }
Example #2
0
    public CameraOpMgr(TrackballCamera cam, GameObject pickingSkipObj)
    {
        container = cam;
        skipObj   = pickingSkipObj;

        pivotInfo = new PivotInfo();
        zoomInfo  = new ZoomInfo(Vector3.Distance(cam.transform.position, pivotInfo.pivotPos));
        rotInfo   = new RotationInfo();

        InitFSM();
    }
Example #3
0
 public void UpdateTubesBatch(Guid rotationID, Guid tuibesBatchID)
 {
     using (WanTaiEntities _WanTaiEntities = new WanTaiEntities())
     {
         RotationInfo rotation = _WanTaiEntities.RotationInfoes.FirstOrDefault(P => P.RotationID == rotationID);
         if (rotation != null)
         {
             rotation.TubesBatchID = tuibesBatchID;
         }
         _WanTaiEntities.SaveChanges();
     }
 }
Example #4
0
        public void UpdataRotationStatus(Guid RotationID, RotationInfoStatus State)
        {
            using (WanTaiEntities _WanTaiEntities = new WanTaiEntities())
            {
                RotationInfo Rotation = _WanTaiEntities.RotationInfoes.Where(_Rotation => _Rotation.RotationID == RotationID).FirstOrDefault();
                if (Rotation != null)
                {
                    Rotation.State = (short)State;
                }

                _WanTaiEntities.SaveChanges();
            }
        }
Example #5
0
    /// <summary>
    /// Rotates a random side of the cube
    /// </summary>
    public void RandomRotateSide()
    {
        // Dont turn the same side multiple times after each other
        int turnId = Random.Range(0, 6);

        turnId = (turnId == previousTurnId) ? turnId + 1 : turnId;
        turnId = (turnId == 6) ? 0 : turnId;

        previousTurnId = turnId;

        RotationInfo rotationInfo = presetRotations[turnId];

        float rotationValue = Mathf.Sign(Random.Range(-1f, 1f)) * 90;

        RotateSide(rotationInfo.Axis, rotationInfo.PositionValue, rotationValue);
    }
        public RotationInfo GetRotationInfo(Guid rotationID)
        {
            try
            {
                using (WanTaiEntities entities = new WanTaiEntities())
                {
                    RotationInfo rotation = entities.RotationInfoes.FirstOrDefault(c => c.RotationID == rotationID);

                    return(rotation);
                }
            }
            catch (Exception e)
            {
                string errorMessage = e.Message + System.Environment.NewLine + e.StackTrace;
                LogInfoController.AddLogInfo(LogInfoLevelEnum.Error, errorMessage, SessionInfo.LoginName, this.GetType().ToString() + "->" + "GetRotationInfo(Guid rotationID)", SessionInfo.ExperimentID);
                throw;
            }
        }
Example #7
0
        internal PartFactory(CraftFactory craft, NodeCollection shipPart)
        {
            Craft            = craft;
            ShipPart         = shipPart;
            hardpointFactory = new HardpointFactory(craft);

            // Fetch ship part top level data
            descriptor   = ShipPart.Children.OfType <PartDescriptor <Vector3> >().First();
            rotationInfo = ShipPart.Children.OfType <RotationInfo <Vector3> >().First();
            verts        = ShipPart.OfType <MeshVertices <Vector3> >().First();
            vertUV       = ShipPart.OfType <VertexUV <Vector2> >().First();
            vertNormals  = ShipPart.OfType <VertexNormals <Vector3> >().First();

            // All meshes are contained inside of a MeshLod
            // There is only one MeshLod per part.
            // Each LOD is BranchNode containing a collection of meshes and textures it uses.
            var lodNode = ShipPart.OfType <LodCollection>().First();

            _lods = new List <LodFactory>();
            int newLodIndex = 0;

            for (int i = 0; i < lodNode.MaxRenderDistance.Count; i++)
            {
                float distance = lodNode.MaxRenderDistance[i];

                // Out of order LODs are probably broken.  See TIE98 CAL.OPT.
                // If this distance is greater than the previous distance (smaller number means greater render distance),
                // then this LOD is occluded by the previous LOD.
                if (distance > 0 && i > 0 && distance > lodNode.MaxRenderDistance[i - 1])
                {
                    continue;
                }

                if (lodNode.Children[i] is NodeCollection branch)
                {
                    _lods.Add(new LodFactory(this, branch, newLodIndex, distance));
                    newLodIndex++;
                }
                else
                {
                    Debug.LogError("Skipping LOD" + newLodIndex + " as it is not a NodeCollection");
                }
            }
        }
        public List <RotationInfo> GetFinishedRotation(Guid experimentId)
        {
            List <RotationInfo> recordList = new List <RotationInfo>();

            try
            {
                string connectionString = WanTai.Common.Configuration.GetConnectionString();
                string commandText      = "SELECT distinct RotationInfo.RotationID, RotationInfo.RotationName"
                                          + " FROM Plates LEFT JOIN RotationInfo on Plates.RotationID = RotationInfo.RotationID"
                                          + " WHERE Plates.PlateType=@PlateType and Plates.ExperimentID=@ExperimentID and RotationInfo.State=@RotationState";
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();

                    using (SqlCommand cmd = new SqlCommand(commandText, conn))
                    {
                        cmd.Parameters.AddWithValue("@PlateType", PlateType.PCR_Plate);
                        cmd.Parameters.AddWithValue("@ExperimentID", experimentId);
                        cmd.Parameters.AddWithValue("@RotationState", RotationInfoStatus.Finish);

                        using (SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.Default))
                        {
                            while (reader.Read())
                            {
                                RotationInfo info = new RotationInfo();
                                info.RotationID   = (Guid)reader.GetValue(0);
                                info.RotationName = reader.GetValue(1).ToString();
                                recordList.Add(info);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                string errorMessage = e.Message + System.Environment.NewLine + e.StackTrace;
                LogInfoController.AddLogInfo(LogInfoLevelEnum.Error, errorMessage, SessionInfo.LoginName, this.GetType().ToString() + "->GetFinishedRotation", experimentId);
                throw;
            }

            return(recordList);
        }
Example #9
0
        public List <RotationInfo> GetPCRResultRotation()
        {
            List <RotationInfo> recordList = new List <RotationInfo>();

            try
            {
                string connectionString = WanTai.Common.Configuration.GetConnectionString();
                //string commandText = "  select RotationID, RotationName from  RotationInfo"+
                //    " where RotationID in ( select distinct RotationID FROM PCRTestResult WHERE ExperimentID = @ExperimentID)";
                string commandText = "  select RotationID, RotationName from  RotationInfo" +
                                     " where ExperimentID = @ExperimentID";
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();

                    using (SqlCommand cmd = new SqlCommand(commandText, conn))
                    {
                        cmd.Parameters.AddWithValue("@ExperimentID", SessionInfo.ExperimentID);

                        using (SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.Default))
                        {
                            while (reader.Read())
                            {
                                RotationInfo info = new RotationInfo();
                                info.RotationID   = (Guid)reader.GetValue(0);
                                info.RotationName = reader.GetValue(1).ToString();
                                recordList.Add(info);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                string errorMessage = e.Message + System.Environment.NewLine + e.StackTrace;
                LogInfoController.AddLogInfo(LogInfoLevelEnum.Error, errorMessage, SessionInfo.LoginName, this.GetType().ToString() + "->GetPCRResultRotation", SessionInfo.ExperimentID);
                throw;
            }

            return(recordList);
        }
Example #10
0
        public void UpdataExperimentStatus(Guid ExperimentID, bool isFinal, ExperimentStatus State, Guid RotationID, RotationInfoStatus RotationState)
        {
            using (WanTaiEntities _WanTaiEntities = new WanTaiEntities())
            {
                ExperimentsInfo experiment = _WanTaiEntities.ExperimentsInfoes.Where(c => c.ExperimentID == ExperimentID).FirstOrDefault();
                if (experiment != null)
                {
                    experiment.State = (short)State;
                    if (isFinal)
                    {
                        experiment.EndTime = DateTime.Now;
                    }
                }

                RotationInfo Rotation = _WanTaiEntities.RotationInfoes.Where(_Rotation => _Rotation.RotationID == RotationID).FirstOrDefault();
                if (Rotation != null)
                {
                    Rotation.State = (short)RotationState;
                }
                _WanTaiEntities.SaveChanges();
            }
        }
Example #11
0
        private void save_button_Click(object sender, RoutedEventArgs e)
        {
            if (!validate())
            {
                return;
            }

            List <RotationInfo> rotationInfoList = new List <RotationInfo>();

            foreach (DataRow row in dataTable.Rows)
            {
                RotationInfo rotationInfo = new RotationInfo();
                rotationInfo.RotationID   = WanTaiObjectService.NewSequentialGuid();
                rotationInfo.ExperimentID = SessionInfo.ExperimentID;
                if (row["TubesBatchID"] != null && !string.IsNullOrEmpty(row["TubesBatchID"].ToString()))
                {
                    rotationInfo.TubesBatchID = new Guid(row["TubesBatchID"].ToString());
                }

                if (row["RotationName"] != null && !string.IsNullOrEmpty(row["RotationName"].ToString()))
                {
                    rotationInfo.RotationName = row["RotationName"].ToString();
                }

                rotationInfo.State      = (short)RotationInfoStatus.Create;
                rotationInfo.CreateTime = DateTime.Now;

                OperationConfiguration operation = row["Operation"] as OperationConfiguration;
                rotationInfo.OperationID   = operation.OperationID;
                rotationInfo.OperationName = operation.OperationName;

                rotationInfo.RotationSequence = (short)row["Sequence"];

                rotationInfoList.Add(rotationInfo);
            }

            if (controller.Create(rotationInfoList))
            {
                //if (SessionInfo.PraperRotation == null)
                //{
                Guid RotationID = Guid.Empty;
                if (SessionInfo.PraperRotation != null)
                {
                    RotationID = SessionInfo.PraperRotation.RotationID;
                }
                SessionInfo.PraperRotation = rotationInfoList.FirstOrDefault();

                FormulaParameters formulaParameters = SessionInfo.RotationFormulaParameters[RotationID];
                SessionInfo.RotationFormulaParameters.Remove(RotationID);
                if (!SessionInfo.RotationFormulaParameters.ContainsKey(SessionInfo.PraperRotation.RotationID))
                {
                    SessionInfo.RotationFormulaParameters.Add(SessionInfo.PraperRotation.RotationID, formulaParameters);
                }
                else
                {
                    SessionInfo.RotationFormulaParameters[SessionInfo.PraperRotation.RotationID] = formulaParameters;
                }
                // }


                //  MessageBox.Show("保存成功!", "系统提示");
                if (NextStepEvent != null)
                {
                    NextStepEvent(sender, e);
                }

                this.next_button.IsEnabled = true;
            }
            else
            {
                MessageBox.Show("保存失败!", "系统提示");
            }
        }
Example #12
0
 public static MarbleInto Trap(int fromIx, int intoIx, RotationInfo rotation4)
 {
     return(new MarbleInto(fromIx, intoIx, false, rotation4));
 }
Example #13
0
 private MarbleInto(int fromIx, int intoIx, bool gap, RotationInfo rotation4)
 {
     FromIndex = fromIx; IntoIndex = intoIx; IsGap = gap; Rotation4 = rotation4;
 }