Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
4.1 KiB

  1. module CTopDrivePanel
  2. use CTopDrivePanelVariables
  3. use SimulationVariables
  4. use CLog3
  5. implicit none
  6. public
  7. contains
  8. subroutine TopDrivePanelFromJson(parent)
  9. type(json_value),pointer :: parent
  10. type(json_core) :: json
  11. type(json_value),pointer :: p,pval
  12. logical::is_found
  13. ! 1. get related root
  14. call json%get(parent,'TopDrivePanel',p)
  15. ! 2. get member of data type from node
  16. call json%get(p,'TopDriveTdsPowerState',pval)
  17. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerState)
  18. call json%get(p,'TopDriveTorqueWrench',pval)
  19. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrench)
  20. call json%get(p,'TopDriveDrillTorqueState',pval)
  21. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveDrillTorqueState)
  22. call json%get(p,'TopDriveLinkTiltState',pval)
  23. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltState)
  24. call json%get(p,'TopDriveIbop',pval)
  25. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbop)
  26. call json%get(p,'TopDriveTorqueLimitKnob',pval)
  27. call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob)
  28. call json%get(p,'RpmKnob',pval)
  29. call json%get(pval,data%Equipments%TopDrivePanel%RpmKnob)
  30. ! call json%get(p,'TopDriveOperationFaultLed',pval)
  31. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveOperationFaultLed)
  32. ! call json%get(p,'TopDriveTdsPowerLed',pval)
  33. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerLed)
  34. ! call json%get(p,'TopDriveTorqueWrenchLed',pval)
  35. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed)
  36. ! call json%get(p,'TopDriveLinkTiltLed',pval)
  37. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltLed)
  38. ! call json%get(p,'TopDriveIbopLed',pval)
  39. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbopLed)
  40. ! call json%get(p,'TopDriveTorqueLimitGauge',pval)
  41. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge)
  42. ! call json%get(p,'TopDriveTorqueGauge',pval)
  43. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueGauge)
  44. ! call json%get(p,'TopDriveRpmGauge',pval)
  45. ! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveRpmGauge)
  46. end subroutine
  47. subroutine TopDrivePanelToJson(parent)
  48. type(json_value),pointer :: parent
  49. type(json_core) :: json
  50. type(json_value),pointer :: p,pform
  51. ! 1. create new node
  52. call json%create_object(p,'TopDrivePanel')
  53. ! call json%add(pform,"TopDriveTdsPowerState",data%Equipments%TopDrivePanel%TopDriveTdsPowerState)
  54. ! call json%add(pform,"TopDriveTorqueWrench",data%Equipments%TopDrivePanel%TopDriveTorqueWrench)
  55. ! call json%add(pform,"TopDriveDrillTorqueState",data%Equipments%TopDrivePanel%TopDriveDrillTorqueState)
  56. ! call json%add(pform,"TopDriveLinkTiltState",data%Equipments%TopDrivePanel%TopDriveLinkTiltState)
  57. ! call json%add(pform,"TopDriveIbop",data%Equipments%TopDrivePanel%TopDriveIbop)
  58. ! call json%add(pform,"TopDriveTorqueLimitKnob",data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob)
  59. ! call json%add(pform,"RpmKnob",data%Equipments%TopDrivePanel%RpmKnob)
  60. call json%add(pform,"TopDriveOperationFaultLed",data%Equipments%TopDrivePanel%TopDriveOperationFaultLed)
  61. call json%add(pform,"TopDriveTdsPowerLed",data%Equipments%TopDrivePanel%TopDriveTdsPowerLed)
  62. call json%add(pform,"TopDriveTorqueWrenchLed",data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed)
  63. call json%add(pform,"TopDriveLinkTiltLed",data%Equipments%TopDrivePanel%TopDriveLinkTiltLed)
  64. call json%add(pform,"TopDriveIbopLed",data%Equipments%TopDrivePanel%TopDriveIbopLed)
  65. call json%add(pform,"TopDriveTorqueLimitGauge",data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge)
  66. call json%add(pform,"TopDriveTorqueGauge",data%Equipments%TopDrivePanel%TopDriveTorqueGauge)
  67. call json%add(pform,"TopDriveRpmGauge",data%Equipments%TopDrivePanel%TopDriveRpmGauge)
  68. call json%add(parent,p)
  69. end subroutine
  70. end module CTopDrivePanel