GSIMotion.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using GSG.NET.Concurrent;
  2. using OHV.SqliteDAL;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace VehicleControlSystem.ControlLayer.Motion
  9. {
  10. /// <summary>
  11. /// 나성권 부장이 만든 Dll 을 사용할 클래스
  12. /// </summary>
  13. public class GSIMotion : ControlObjectBase
  14. {
  15. public bool IsStop { get; set; }
  16. double currentPos = 0;
  17. public double CurrentPos { get { return this.currentPos; } set { SetField(ref this.currentPos, value); } }
  18. private string currentTag;
  19. public string CurrentTag { get { return currentTag; } set { SetField(ref this.currentTag, value); } }
  20. private double currentSpeed;
  21. public double CurrentSpeed { get { return currentSpeed; } set { SetField(ref this.currentSpeed, value); } }
  22. private double currentTorque;
  23. public double CurrentTorque { get { return currentTorque; } set { SetField(ref this.currentTorque, value); } }
  24. public bool IsErrorOn { get; set; }
  25. TaskCancel taskCancel = new TaskCancel();
  26. SqliteManager sql = null;
  27. public GSIMotion(SqliteManager sql)
  28. {
  29. this.sql = sql;
  30. }
  31. public void Init()
  32. {
  33. }
  34. public bool MoveToPoint(string point, double velocity)
  35. {
  36. var task = Task.Factory.StartNew(() =>
  37. {
  38. int index = 0;
  39. while (true)
  40. {
  41. LockUtils.Wait(500);
  42. this.CurrentPos = index++;
  43. if (CurrentPos > 20)
  44. break;
  45. }
  46. });
  47. return true;
  48. }
  49. public void EStop()
  50. {
  51. }
  52. public bool Stop()
  53. {
  54. return true;
  55. }
  56. public bool SlowStop()
  57. {
  58. return true;
  59. }
  60. public bool VelocityChainge(double velocity)
  61. {
  62. return true;
  63. }
  64. public bool AmpFaultReset()
  65. {
  66. return true;
  67. }
  68. #region Test Method
  69. #endregion
  70. }
  71. }