private unsafe void writeToArray(ushort* ProcessData, getPointLocation location) { int index_value = 0; if (!TimeStampFrag && TimeStampWriteFlag) { DateTime dtnow = DateTime.Now; writingSw.Write("\nwriting start\n" + dtnow.ToString() + "\r\n"); //time stamp writingCenter.Write("\nwriting start\n" + dtnow.ToString() + "\r\n"); //time stamp } TimeStampFrag = true; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { index_value = i * 3 + j; fukuisan[index_value + writeDownedCounter * 9] = shiburinkawaiiyoo(ProcessData, location.X - distance_fukuisan_horizonal + j * distance_fukuisan_horizonal, location.Y - distance_fukuisan_vertial + i * distance_fukuisan_vertial); this.ValueLabels[index_value].Content = fukuisan[index_value + writeDownedCounter * 9]; } } old_fukuisan[writeDownedCounter] = shiburinkawaiiyoo(ProcessData, location.X,location.Y); writeDownedCounter++; if (writeDownedCounter == fukuisan.Length / 9) { WritingFlag = false; writeToText(); ButtonWriteDown.IsEnabled = true; } }
private void Viewbox1_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { getPointLocation temp = new getPointLocation(this.Viewbox1.PointToScreen(new Point(0, 0))); if (cursol_locked) { mouse = temp; } cursol_locked = !cursol_locked; this.ButtonWriteDown.IsEnabled = cursol_locked; }
private unsafe ushort shiburinkawaiiyoo(ushort* ProcessData, getPointLocation location) { return ProcessData[(int)(location.Y * this.depthFrameDescription.Width + location.X)]; }
private unsafe void TextGenerate(ushort* ProcessData) { string Resolution = "Resolution " + this.depthFrameDescription.Width.ToString() + "x" + this.depthFrameDescription.Height.ToString(); string CursorLocation; ushort Value; p = this.Viewbox1.PointToScreen(new Point(0, 0)); getPointLocation mouseInPicture = new getPointLocation(p); if (cursol_locked) { mouseInPicture = (bool)(this.CheckLockCenter.IsChecked) ? getLockPosition() : mouse; if (WritingFlag) { writeToArray(ProcessData, mouseInPicture); } else { TimeStampFrag = false; } CursorLocation = " Cursor Location " + (mouseInPicture.X.ToString() + " " + mouseInPicture.Y.ToString()); Value = shiburinkawaiiyoo(ProcessData, mouseInPicture); } else { if (Viewbox1.IsMouseOver) { CursorLocation = " Cursor Location " + (mouseInPicture.X.ToString() + " " + mouseInPicture.Y.ToString()); Value = shiburinkawaiiyoo(ProcessData, mouseInPicture); } else { CursorLocation = "out of image"; Value = 9000; if (counter % (int)(30 / fps_graph) == 0) { //graphGenerateHorizonal(ProcessData, mouseInPicture); //graphGenerateTimeDomain(ProcessData, mouseInPicture); } } } this.StatusText = Resolution + CursorLocation + " cursor lock is " + cursol_locked.ToString() + " " + Value.ToString() + " Writing is " + " Writed sample number =" + writeDownedCounter.ToString(); }
private getPointLocation getLockPosition() { double temp; getPointLocation LockPosition = new getPointLocation(); if (double.TryParse(this.textXlock.Text, out temp)) { LockPosition.X = temp; } else { return mouse; } if (double.TryParse(this.textYlock.Text, out temp)) { LockPosition.Y = temp; } else { return mouse; } if((0 <= LockPosition.X && LockPosition.X < this.depthFrameDescription.Width) && (0 <= LockPosition.Y && LockPosition.Y < this.depthFrameDescription.Height)) { return LockPosition; } else { return mouse; } }