open-insight/LSL2/OIEVENT/CREATE/REACT_TUBE_CHG..json
2024-03-25 15:12:53 -07:00

11 lines
1.6 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function msg, send_event, admin_user, center_window, xlate, memberof, set_property\r\ndeclare function send_message, post_event\r\ndeclare subroutine end_dialog\r\n\r\n$insert msg_equates\r\n$insert react_tube_chg_equ\r\n$insert logical\r\ndeclare subroutine array_sort\r\n\r\nif index( CreateParam, 'CENTER', 1 ) then\r\n void = center_window( @window )\r\nend else\r\n Void = set_property( @window, 'VISIBLE', 1 )\r\nend\r\n\r\nopen 'CONFIG' to ConfigTable else\r\n Void = msg( '', 'Unable to open CONFIG table' )\r\n end_dialog( @window, '' )\r\n return 0\r\nend\r\nread ReactTubeInfo from ConfigTable, 'REACT_TUBE_CHG' then\r\n if ReactTubeInfo <> '' then\r\n\t Reactors = ReactTubeInfo<RTCReactor$>\r\n\t LastDone = oconv( ReactTubeInfo<RTCLastDone$>, 'D2/' )\r\n\t ReactorLogIDs = ReactTubeInfo<RTCReactorLogID$>\r\n ReactElapsedHrs = xlate( 'REACTOR_LOG', ReactorLogIDs, 'REACT_HRS_ELAPSED', 'X' )\r\n \r\n * NEED TO SORT BY DSND HOURS\r\n ArraysToPass = ReactElapsedHrs:@fm:Reactors:@fm:LastDone:@fm:ReactorLogIDs\r\n array_sort( ArraysToPass, 'D', 'R' )\r\n NewArray = ''\r\n HoldHrs = ArraysToPass<1>\r\n NewArray<4> = ArraysToPass<1>\r\n NewArray<3> = ArraysToPass<4>\r\n NewArray<2> = ArraysToPass<3>\r\n NewArray<1> = ArraysToPass<2>\r\n *.tube_chg_info->array = ReactTubeInfo:@fm:ReactElapsedHrs\r\n .tube_chg_info->array = NewArray\r\n end\r\nend\r\nRETURN 1"
}
}
}