예제 #1
0
        public void SaveUsingModelClass()
        {
            ProductionModel model = new ProductionModel {
                Location = location
            };

            DateTime before = DateTime.UtcNow.AddSeconds(-1);

            dynamic record = ViewPoint.Save(model);

            DateTime after = before.AddSeconds(5);

            Assert.That((object)record, Is.Not.Null);

            Assert.That(record.Location, Is.EqualTo(location));

            Assert.That(record.Id, Is.GreaterThan(0));

            Assert.That(Records, Is.Not.Empty);

            InMemoryRecord amplaRecord = Records[0];

            Assert.That(amplaRecord, Is.Not.Null);

            Assert.That(amplaRecord.Location, Is.EqualTo(location));
            Assert.That(amplaRecord.Module, Is.EqualTo(module));

            Assert.That(amplaRecord.GetFieldValue("Sample Period", DateTime.MinValue), Is.InRange(before, after));
        }
예제 #2
0
        /// <summary>
        /// 添加一个观点
        /// </summary>
        /// <param name="_info"></param>
        /// <returns></returns>
        public bool AddViewPoint(ViewPoint _info, out int id)
        {
            string       sql    = "proc_Add_ViewPoint";
            SqlParameter thisID = new SqlParameter("@thisID", 0);

            thisID.Direction = ParameterDirection.Output;
            SqlParameter[] para =
            {
                new SqlParameter("@article",   _info.Article),
                new SqlParameter("@title",     _info.Title),
                new SqlParameter("@TpId",      _info.TpId),
                new SqlParameter("@Istop",     _info.Istop),
                new SqlParameter("@vtag",      _info.vtag),
                new SqlParameter("@MetaKey",   _info.MetaKey),
                new SqlParameter("@MetaDesc",  _info.MetaDesc),
                new SqlParameter("@CShortDes", _info.CShortDes),
                thisID
            };
            id = 0;
            if (DbHelper.ExecuteCommandByProc(sql, para) > 0)
            {
                id = Convert.ToInt32(thisID.Value);
                return(true);
            }
            return(false);
        }
예제 #3
0
    void InitCameraPosition(ViewPoint v = ViewPoint.Right)
    {
        switch (v)
        {
        case ViewPoint.Diagonally:
            //offset = new Vector3(0, 5.5f, -6f) - new Vector3(0, 0, 0);
            offset             = new Vector3(0, 5.5f, -5f) - new Vector3(0, 0, 0);
            transform.rotation = Quaternion.Euler(50, 0, 0);
            break;

        /*
         * case ViewPoint.TPP:
         *  offset = new Vector3(0, 3f, 3f) - new Vector3(0, 0, 0);
         *  //transform.rotation = Quaternion.Euler(45, 180, 0);
         *  break;
         * case ViewPoint.FPP:
         *  offset = new Vector3(0, 5.5f, -6f) - new Vector3(0, 0, 0);
         *  transform.rotation = Quaternion.Euler(50, 0, 0);
         *  break;
         */
        default:     //case ViewPoint.Right:
            offset             = new Vector3(0, 11.5f, 0.5f) - new Vector3(0, 0, 0);
            transform.rotation = Quaternion.Euler(90, 0, 0);
            break;
        }
        posZ = 0.5f;
    }
예제 #4
0
 /// <summary>
 /// Update BCFView to have consistent values with the MainWindow
 /// </summary>
 private void UpdateBCFView()
 {
     try
     {
         selectedComponent = filteredComponents[selectedComponentIndex];
         int       fileIndex         = bcfView.SelectedIndex;
         int       markupIndex       = bcfView.BCFFiles[fileIndex].SelectedMarkup;
         ViewPoint selectedViewpoint = bcfView.BCFFiles[fileIndex].Markups[markupIndex].SelectedViewpoint;
         int       viewpointIndex    = bcfView.BCFFiles[fileIndex].Markups[markupIndex].Viewpoints.IndexOf(selectedViewpoint);
         var       componentFound    = from comp in selectedViewpoint.VisInfo.Components where comp.Guid == selectedComponent.Guid select comp;
         if (componentFound.Count() > 0)
         {
             int componentIndex = selectedViewpoint.VisInfo.Components.IndexOf(componentFound.First());
             if (componentIndex > -1)
             {
                 bcfView.BCFFiles[fileIndex].Markups[markupIndex].Viewpoints[viewpointIndex].VisInfo.Components[componentIndex].Action         = filteredComponents[selectedComponentIndex].Action;
                 bcfView.BCFFiles[fileIndex].Markups[markupIndex].Viewpoints[viewpointIndex].VisInfo.Components[componentIndex].Responsibility = filteredComponents[selectedComponentIndex].Responsibility;
                 bcfView.BCFFiles[fileIndex].Markups[markupIndex].SelectedViewpoint = bcfView.BCFFiles[fileIndex].Markups[markupIndex].Viewpoints[viewpointIndex];
             }
         }
     }
     catch (Exception ex)
     {
         string message = ex.Message;
     }
 }
예제 #5
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Customize Time Configuration
            gen.snd.TimeConfiguration.Instance.Latency = 8000;
            gen.snd.TimeConfiguration.Instance.Rate    = 44100;

            ViewCollection = ViewPoint.EnumerateViewTypes <MasterViewContainer>(System.Reflection.Assembly.GetExecutingAssembly());

            List <string> views = new List <string>();

            foreach (IViewPoint view in ViewCollection)
            {
                views.Add(view.Title);
            }

            // MessageBox.Show(string.Join("\n",views.ToArray()));
            Application.Run(new ModestForm(ViewCollection));
//			try { Application.Run( container.GetExportedValue<ModestForm>() ); }
//			catch (Exception ex) {
//				if ( MessageBox.Show(string.Format("{0}\n---------\n{1}",ex.Message,ex.StackTrace), "OK to Exit, Cancel to throw Exception.", MessageBoxButtons.OKCancel,MessageBoxIcon.Error) == DialogResult.OK ) throw ex;
//				else return;
//			}
        }
예제 #6
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            Point RelativeLocation = e.Location.Add(ViewPoint);

            MouseDelta = PreviousMouseLocation.Subtract(e.Location);

            if (Wiring)
            {
                WiringCurrentPoint = RelativeLocation;
                Invalidate();
            }

            if (SelectedNode != null && e.Button == MouseButtons.Left)
            {
                SelectedNode.Position = RelativeLocation.Add(SelectedNodeOffset);

                if (GridSnapping)
                {
                    SelectedNode.Position = SelectedNode.Position.Snap(GridSize);
                }

                Invalidate();
            }

            if (e.Button == MouseButtons.Middle)
            {
                ViewPoint = ViewPoint.Add(MouseDelta);
                Invalidate();
            }

            PreviousMouseLocation = e.Location;
        }
예제 #7
0
 void SwitchViewPoint(ViewPoint target)
 {
     Debug.Log("New View is " + target.GetName());
     targetView            = target;
     currentCameraDistance = targetView.GetCameraDistance();
     cs.SetTargetView(target);
 }
예제 #8
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.V))
        {
            int vptmp = (int)vp + 1;
            if (vptmp > System.Enum.GetValues(typeof(ViewPoint)).Length - 1)
            {
                vptmp = 0;
            }
            vp = (ViewPoint)vptmp;
            InitCameraPosition(vp);
        }

        Vector3 tmp = target.position + offset;

        switch (vp)
        {
        case ViewPoint.Right:
            transform.position = new Vector3(tmp.x, tmp.y, posZ);     // Diagonally
            break;

        /*
         * case ViewPoint.TPP:
         *  transform.position = tmp; // Diagonally
         *  transform.LookAt(target);
         *  break;
         */
        default:
            transform.position = tmp;
            break;
        }
    }
예제 #9
0
        public ChatMenu()
        {
            screenSize = GUCView.GetScreenSize();
            chatHeigth = screenSize.Y / 5;
            chatWidth  = screenSize.X - 350;

            chatBackground = new GUCVisual(0, 0, chatWidth, chatHeigth + 5);
            chatBackground.SetBackTexture("Dlg_Conversation.tga");

            const int space = 20;
            int       lines = chatHeigth / space;

            for (int i = 0; i < lines; i++)
            {
                chatBackground.CreateText("" + i, 20, 5 + i * space);
                chatBackground.Texts[i].Text = "";
            }

            textBox = new GUCTextBox(70, chatHeigth + 5, chatWidth - 90, false);
            prefix  = new GUCVisual(15, chatHeigth + 5, chatWidth, 20);
            prefix.CreateText("", 0, 0);

            chatInactivityTimer = new GUCTimer();
            chatInactivityTimer.SetCallback(() => { if (!textBox.Enabled)
                                                    {
                                                        chatBackground.Hide();
                                                    }
                                                    chatInactivityTimer.Stop(); });
            chatInactivityTimer.SetInterval(6 * TimeSpan.TicksPerSecond);
        }
예제 #10
0
        public ChatMenu(Chat chat)
        {
            _Chat = chat ?? throw new ArgumentNullException(nameof(chat));
            _Chat.ChatMessageReceived += (sender, args) => ReceiveServerMessage(args.Mode, args.Message);


            screenSize = GUCView.GetScreenSize();
            chatHeigth = screenSize.Y / 5;
            chatWidth  = screenSize.X - 350;

            chatBackground = new GUCVisual(0, 0, chatWidth, chatHeigth + 5);
            chatBackground.SetBackTexture("Dlg_Conversation.tga");

            const int space = 20;
            int       lines = chatHeigth / space;

            for (int i = 0; i < lines; i++)
            {
                chatBackground.CreateText("" + i, 20, 5 + i * space);
                chatBackground.Texts[i].Text = "";
            }

            textBox = new GUCTextBox(70, chatHeigth + 5, chatWidth - 90, false);
            prefix  = new GUCVisual(15, chatHeigth + 5, chatWidth, 20);
            prefix.CreateText("", 0, 0);

            chatInactivityTimer = new GUCTimer();
            chatInactivityTimer.SetCallback(() => { if (!textBox.Enabled)
                                                    {
                                                        chatBackground.Hide();
                                                    }
                                                    chatInactivityTimer.Stop(); });
            chatInactivityTimer.SetInterval(6 * TimeSpan.TicksPerSecond);
        }
예제 #11
0
 void UpdateViewPoint()
 {
     defView  = new ViewPoint("Default View", defTrans, defDis, false, true, false);
     farView  = new ViewPoint("Far View", farTrans, farDis, false, true, false);
     aimView  = new ViewPoint("Aim View", aimTrans, aimDis, false, true, false);
     backView = new ViewPoint("Back View", backTrans, backDis, false, true, false);
 }
예제 #12
0
        public void setUpCamera(double aspectRatio)
        {
            // Create a camera or eye point.
            Vector3D Direction = new Vector3D(0.0f, -0.05f, 1.0f);
            Vector3D Location  = new Vector3D(0.0f, -5.0f, -110.0f);
            Vector3D Right     = new Vector3D(1.0f, 0.0f, 0.0f);
            Vector3D Up        = new Vector3D(0.0f, aspectRatio, 0.0f);

            Camera = new ViewPoint(Direction, Location, Right, Up);
        }
예제 #13
0
    void SaveGlovbalSettings()
    {
        int[] playerStatus = player.GetComponent <PlayerController>().GetPlayerStatus();

        for (int i = 0; i < playerStatus.Length; i++)
        {
            PlayerStatusNumArr[i] = playerStatus[i];
        }

        viewPoint = mainCamera.GetComponent <CameraController>().GetViewPoint();
    }
        public MainWindow()
        {
            LoadSettings();

            InitializeComponent();

            _viewPoint = new ViewPoint(Background);
            _selection = new Selection(Canvas, _currentMod);

            Background.Source = _currentMod.World.ProvinceMap.GetImage();
        }
예제 #15
0
파일: ZoomBox.cs 프로젝트: ycccq/XamlViewer
        private ViewPoint ResetViewPoint()
        {
            var viewPoint = new ViewPoint
            {
                PointToViewport = Mouse.GetPosition(_partScrollContentPresenter)
            };

            viewPoint.PointToScrollContent = new Point(viewPoint.PointToViewport.X + HorizontalOffset, viewPoint.PointToViewport.Y + VerticalOffset);

            return(viewPoint);
        }
 private void viewpointCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (viewpointCombo.SelectedItem != null)
     {
         ViewPoint curVp = (ViewPoint)viewpointCombo.SelectedItem;
         viewpointItems.SelectedObject = curVp.ViewpointRef;
     }
     else
     {
         viewpointItems.SelectedObject = null;
     }
 }
예제 #17
0
        // Scene creation
        public override void CreateScene()
        {
            camera.NearClipDistance = 4F;
            camera.FarClipDistance  = 4000F;

            ViewPoint vp = sceneMgr.GetSuggestedViewpoint(true);

            camera.Position = vp.Position;
            camera.Pitch(new Degree(90F));
            //camera.Rotate(vp.Orientation);
            camera.SetFixedYawAxis(true, Vector3.UNIT_Z);
        }
예제 #18
0
        private void SetViewPoint(string imageFile)
        {
            try
            {
                var count = 5;
                while (!File.Exists(imageFile))
                {
                    count--;
                    if (count < 0)
                    {
                        break;
                    }
                    Thread.Sleep(100);
                }

                if (!File.Exists(imageFile))
                {
                    return;
                }

                var vp = new ViewPoint();
                vp.Guid          = Guid.NewGuid().ToString();
                vp.TopicGuid     = ViewPointViewModel.SelectedMarkup.Topic.Guid;
                vp.Snapshot      = Path.GetFileName(imageFile);
                vp.SnapshotImage = ImageUtil.GetImageArray(imageFile);

                var visInfo = new VisualizationInfo();
                visInfo.ViewPointGuid = vp.Guid;
                //update components
                visInfo.Components = GetElements(vp.Guid);

                //update camera
                var currentView = ActiveDoc.ActiveView as View3D;
                if (null != currentView)
                {
                    if (currentView.IsPerspective)
                    {
                        visInfo.PerspectiveCamera = GetPerspectiveCamera(currentView, vp.Guid);
                    }
                    else
                    {
                        visInfo.OrthogonalCamera = GetOrthogonalCamera(currentView, vp.Guid);
                    }
                }

                vp.VisInfo = visInfo;
                ViewPointViewModel.UserViewPoint = vp;
            }
            catch (Exception)
            {
                // ignored
            }
        }
        private void viewpoints_SelectedIndexChanged(object sender, EventArgs e)
        {
            viewpointItems.Items.Clear();

            if (viewpointList.SelectedItems.Count == 1)
            {
                ViewPoint curVp = (ViewPoint)viewpointList.SelectedItems[0].Tag;
                viewpointItems.Items.Add("Index").SubItems.Add(curVp.Index.ToString());
                if (curVp.ViewpointRef.OrthogonalCamera != null)
                {
                    viewpointItems.Items.Add("OrthogonalCamera");
                    viewpointItems.Items.Add("  Direction");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraDirection.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraDirection.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraDirection.Z.ToString());
                    viewpointItems.Items.Add("  Viewpoint");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraViewPoint.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraViewPoint.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraViewPoint.Z.ToString());
                    viewpointItems.Items.Add("  UpVector");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraUpVector.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraUpVector.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.CameraUpVector.Z.ToString());
                    viewpointItems.Items.Add("  Scale").SubItems.Add(curVp.ViewpointRef.OrthogonalCamera.ViewToWorldScale.ToString());
                }

                if (curVp.ViewpointRef.PerspectiveCamera != null)
                {
                    viewpointItems.Items.Add("PerspectiveCamera");
                    viewpointItems.Items.Add("  Direction");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraDirection.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraDirection.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraDirection.Z.ToString());
                    viewpointItems.Items.Add("  Viewpoint");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraViewPoint.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraViewPoint.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraViewPoint.Z.ToString());
                    viewpointItems.Items.Add("  UpVector");
                    viewpointItems.Items.Add("    X").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraUpVector.X.ToString());
                    viewpointItems.Items.Add("    Y").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraUpVector.Y.ToString());
                    viewpointItems.Items.Add("    Z").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.CameraUpVector.Z.ToString());
                    viewpointItems.Items.Add("  Scale").SubItems.Add(curVp.ViewpointRef.PerspectiveCamera.FieldOfView.ToString());
                }
                viewpointItems.Items.Add("Guid").SubItems.Add(curVp.Guid);

                viewpointItems.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                viewpointImage.Image = curVp.SnapshotRef;

                ModifyRevitView(curVp);
            }
        }
예제 #20
0
        public SRCoord GetCoord(Point point)
        {
            // Generic map stuffs
            int tileAvg = m_TileCount / 2;
            // Convertion
            double coordX = (point.X + m_TileSize.Width / 2.0 - m_TileSize.Width * tileAvg) * 192 / m_TileSize.Width + ViewPoint.PosX;
            double coordY = (point.Y + m_TileSize.Height / 2.0 - m_TileSize.Height * tileAvg) * 192 / m_TileSize.Height * (-1) + ViewPoint.PosY;

            if (ViewPoint.inDungeon())
            {
                return(new SRCoord(coordX, coordY, ViewPoint.Region, ViewPoint.Z));
            }
            return(new SRCoord(coordX, coordY));
        }
예제 #21
0
        public void StartChangeViewPoint()
        {
            switch (currentViewPoint)
            {
            case ViewPoint.twoDimensional:
                this.currentViewPoint = ViewPoint.threeDimensional;
                OnViewChangedStartTo3D?.Invoke();
                break;

            case ViewPoint.threeDimensional:
                this.currentViewPoint = ViewPoint.twoDimensional;
                OnViewChangedStartTo2D?.Invoke();
                break;
            }
        }
예제 #22
0
파일: BSPSample.cs 프로젝트: axiom3d/axiom
        protected override void SetupView()
        {
            base.SetupView();

            Camera.Near = 4;
            Camera.Far  = 4000;

            ViewPoint vp = SceneManager.GetSuggestedViewpoint(true);

            Camera.FixedYawAxis = Vector3.UnitZ;
            Camera.Pitch(90);
            Camera.Position = vp.position;
            Camera.Rotate(vp.orientation);
            CameraManager.TopSpeed = 350;
        }
        public override void RolePlayerChanged(RolePlayerChangedEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            // we only need to update is the role player changed in the "parent" in the
            // embedding relationship.
            ViewPoint oldValue = e.OldRolePlayer as ViewPoint;
            ViewPoint newValue = e.NewRolePlayer as ViewPoint;

            CompartmentRuleHelper.HandleRolePlayerChangedRule(e.ElementLink,
                                                              oldValue, newValue);
        }
        /*
         * private void IssuesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
         * {
         * topicItems.SelectedObject = null;
         * commentCombo.Items.Clear();
         * viewpointCombo.Items.Clear();
         *
         * if (issuesList.SelectedItems.Count == 1)
         * {
         *    if (((ServiceItem)issuesList.SelectedItems[0]).type.Equals("bcf"))
         *    {
         *       bcfIssue.Visibility = System.Windows.Visibility.Visible;
         *       textIssue.Visibility = System.Windows.Visibility.Hidden;
         *       Markup curMarkup = (Markup)((ServiceItem)issuesList.SelectedItems[0]).issueData;
         *       topicItems.SelectedObject = curMarkup.Topic;
         *
         *       commentCombo.Items.Clear();
         *       if (curMarkup.Comment != null)
         *       {
         *          foreach (Comment com in curMarkup.Comment)
         *             commentCombo.Items.Add(com);
         *          commentCombo.SelectedIndex = 0;
         *       }
         *
         *       viewpointCombo.Items.Clear();
         *       if (curMarkup.Viewpoints != null)
         *       {
         *          foreach (ViewPoint vp in curMarkup.Viewpoints)
         *             viewpointCombo.Items.Add(vp);
         *          viewpointCombo.SelectedIndex = 0;
         *       }
         *    }
         *    else
         *    {
         *       bcfIssue.Visibility = System.Windows.Visibility.Hidden;
         *       textIssue.Visibility = System.Windows.Visibility.Visible;
         *       textIssue.Text = (string)((ServiceItem)issuesList.SelectedItems[0]).textData;
         *    }
         * }
         * }
         */

        private void IssuesList_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            HitTestResult r = VisualTreeHelper.HitTest(this, e.GetPosition(this));

            if (r.VisualHit.GetType() == typeof(Image))
            {
                ViewPoint curVp = (ViewPoint)viewpointCombo.SelectedItem;

                if (curVp != null)
                {
                    ExtEvents.ChangeViewHandler.v = curVp.ViewpointRef;
                    ExtEvents.ChangeViewEvent.Raise();
                }
            }
        }
예제 #25
0
        /// <summary>
        /// 写入页面
        /// </summary>
        public void WirteFile(ViewPointExtend news, ViewPoint NextText, ViewPoint UpText)
        {
            string       path = HttpContext.Current.Server.MapPath("~/FirstPage/viewpoint/");
            Encoding     code = Encoding.GetEncoding("gb2312");
            string       temp = HttpContext.Current.Server.MapPath("viewdetail.html");
            StreamReader sr   = null;
            StreamWriter sw   = null;
            string       str  = "";

            try
            {
                sr  = new StreamReader(temp, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                HttpContext.Current.Response.Write(ex.Message);
                HttpContext.Current.Response.End();
                sr.Close();
            }
            string NextStr = "<span>下一篇:&nbsp;<a href='vdetail_" + NextText.ID + ".html'>" + NextText.Title + "</a></span>";
            string UpStr   = "<span>下一篇:&nbsp;<a href='vdetail_" + UpText.ID + ".html'>" + UpText.Title + "</a></span>";

            str = str.Replace("[title]", news.Title)
                  .Replace("[Content]", news.Article)
                  .Replace("[TypeName]", news.TypeName)
                  .Replace("[UpText]", UpStr)
                  .Replace("[NextText]", NextStr);

            string hurl = "vdetail_" + news.ID.ToString() + ".html";

            try
            {
                sw = new StreamWriter(path + hurl, false, code);
                sw.Write(str);
                sw.Flush();
            }
            catch (Exception ex)
            {
                HttpContext.Current.Response.Write(ex.Message);
                HttpContext.Current.Response.End();
                throw;
            }
            finally
            {
                sw.Close();
            }
        }
예제 #26
0
        public bool AddViewPoint(ViewPoint viewPoint)
        {
            using (var connection = new SqlConnection(System.Configuration.ConfigurationManager
                                                      .ConnectionStrings["DefaultConnection"].ConnectionString))
            {
                string sql =
                    "INSERT INTO ViewPoint(ViewPointID, Name, BeginDate, EndDate, Description) VALUES(@ViewPointID, @Name, @BeginDate, @EndDate, @Description);";

                var rowsAffected = connection.Query <int>(sql, viewPoint).SingleOrDefault();
                if (rowsAffected > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #27
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string indexText = "";

            if (values.Length == 2)
            {
                Markup    markup            = values[0] as Markup;
                ViewPoint selectedViewpoint = values[1] as ViewPoint;
                if (null != markup && null != selectedViewpoint)
                {
                    int index = markup.Viewpoints.IndexOf(selectedViewpoint);
                    indexText = "( " + (index + 1) + " of " + markup.Viewpoints.Count + ")";
                }
            }
            return(indexText);
        }
예제 #28
0
        public bool DeleteViewPoint(ViewPoint viewPoint)
        {
            using (var connection = new SqlConnection(System.Configuration.ConfigurationManager
                                                      .ConnectionStrings["DefaultConnection"].ConnectionString))
            {
                string sql =
                    "DELETE FROM ViewPoint WHERE ViewPointID = @ViewPointId;";

                var rowsAffected = connection.Query <int>(sql, viewPoint).SingleOrDefault();
                if (rowsAffected > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
        public static StandardViewpoint ToStandardViewpoint(ViewPoint viewPoint, List <Comment> comments)
        {
            var standardVp = new StandardViewpoint()
            {
                Date = viewPoint.Date,
                //.Split(',') because the thumbnail string from easy access starts with data type. Base64 contains no ','.
                EncodedThumbnail = viewPoint.ViewPointImage.Thumbnail.Split(',')[1].Trim(),
                Identifiers      = new Dictionary <string, Identifiers>(),
                Url         = viewPoint.ViewPointImage.Url,
                ViewpointId = viewPoint.Id
            };

            SetIdentifiers(viewPoint, standardVp, comments);

            return(standardVp);
        }
예제 #30
0
        /// <summary>
        /// Insert a new viewpoint into the database
        /// </summary>
        /// <param name="vp"></param>
        private void AddViewPoint(ViewPoint vp)
        {
            try
            {
                bcfView.BCFFiles[bcfView.SelectedIndex].Markups[selectedBCF.SelectedMarkup].Viewpoints.Add(vp);
                SetSelectedMarkup();
                this.SelectedMarkup.SelectedViewpoint = vp;

                string fileId = bcfView.BCFFiles[bcfView.SelectedIndex].FileId;
                bool   added  = BCFDBWriter.BCFDBWriter.InsertViewPoint(fileId, vp);
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
예제 #31
0
 public static void SwapAxis(Int32Image src, Int32Image dest, ViewPoint viewPoint, int scale) {
   VisionLabPINVOKE.SwapAxis__SWIG_4(Int32Image.getCPtr(src), Int32Image.getCPtr(dest), (int)viewPoint, scale);
   if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
 }
예제 #32
0
 public static string ViewPointToStr(ViewPoint vp) {
   string ret = VisionLabPINVOKE.ViewPointToStr((int)vp);
   if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
예제 #33
0
 public static void FindFirstTransitions(DoubleImage src, DoubleImage dest, double threshold, ViewPoint viewPoint, ObjectBrightness objectBrightness) {
   VisionLabPINVOKE.FindFirstTransitions__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), threshold, (int)viewPoint, (int)objectBrightness);
   if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
 }
예제 #34
0
 public static void FindFirstEdges(DoubleImage src, DoubleImage dest, double minEdge, ViewPoint viewPoint) {
   VisionLabPINVOKE.FindFirstEdges__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), minEdge, (int)viewPoint);
   if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
 }
예제 #35
0
 void Awake()
 {
     camera = GetComponent<Camera>();
     ViewPoint = initialViewPoint;
     transitionTime = cameraTransitionTime;
 }
        private static void CheckViewPoints(ViewPoint[] points, string parent, params string[] names)
        {
            Assert.That(points, Is.Not.Empty, parent);
            Assert.That(points.Length, Is.EqualTo(names.Length), parent);
            for (int i = 0; i < names.Length; i++)
            {
                string name = names[0];

                Assert.That(points[i].DisplayName, Is.EqualTo(name), "[{0}] {1}", i, parent);
                Assert.That(points[i].LocalizedDisplayName, Is.EqualTo(name), "[{0}] {1}", i, parent);
                Assert.That(points[i].id, Is.EqualTo((parent.Length > 0 ? parent + "." : "") + name), "[{0}] {1}", i, parent);
                Assert.That(points[i].ViewPoints, Is.Not.Null, "[{0}] {1}", i, parent);
                Assert.That(points[i].ReportingPoints, Is.Not.Null, "[{0}] {1}", i, parent);
            }
        }