|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- module CLatchLedNotification
- use COperationScenariosVariables
- use CLog4
- implicit none
- contains
-
- subroutine Evaluate_LatchLed()
- use CCommon
- implicit none
-
-
-
-
- if (DriveType == TopDrive_DriveType) then
- #ifdef OST
- print*, 'Evaluate_LatchLed=TopDrive'
- #endif
-
-
- !TOPDRIVE-CODE=44
- if (Get_HookHeight() <= (TL() + NFC() - ECG) .and.&
- Get_ElevatorConnectionPossible() .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_LatchLed(.true.)
- return
- end if
-
-
-
-
-
-
-
- !TOPDRIVE-CODE=45
- if ((Get_HookHeight() >= (TL() + SL - ECG + NFC()) .and. Get_HookHeight() <= (TL() + SL - ECG + NFC() + TG)) .and.&
- GetStandRack() > 0 .and.&
- Get_JointConnectionPossible() == .false. .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_LatchLed(.true.)
- return
- end if
-
-
-
-
-
-
- !TOPDRIVE-CODE=46
- if ((Get_HookHeight() >= (TL() + SL - ECG + NFC()) .and. Get_HookHeight() <= (TL() + SL - ECG + NFC() + TG)) .and.&
- Get_ElevatorConnectionPossible() .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
- Get_TdsSwing() == TDS_SWING_TILT_END .and.&
- Get_FillMouseHoleLed()) then
-
- call Set_LatchLed(.true.)
- return
- end if
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- endif
-
-
-
-
-
-
-
- if (DriveType == Kelly_DriveType) then
- #ifdef OST
- print*, 'Evaluate_LatchLed=Kelly'
- #endif
-
- !OPERATION-CODE=36
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- Get_HookHeight() <= (HL + Get_NearFloorConnection() - ECG) .and.&
- Get_ElevatorConnectionPossible() .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- !Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.&
- !Get_UnlatchLed() .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- !call Log_4("OPERATION-CODE=36")
- call Set_LatchLed(.true.)
- !call Set_UnlatchLed(.false.)
- return
- end if
-
-
- !OPERATION-CODE=37
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- Get_StandRack() > 0 .and.&
- Get_HookHeight() >= (HL + SL - ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (HL + SL - ECG + Get_NearFloorConnection() + LG) .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- !Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.&
- Get_ElevatorConnectionPossible() == .false. .and.&
- !Get_UnlatchLed() .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- !call Log_4("OPERATION-CODE=37")
- call Set_LatchLed(.true.)
- !call Set_UnlatchLed(.false.)
- return
- end if
-
-
-
-
-
-
-
-
-
-
-
-
-
- !OPERATION-CODE=38
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- Get_ElevatorConnectionPossible() .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- !Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.&
- !Get_UnlatchLed() .and.&
- Get_Swing() == SWING_MOUSE_HOLE_END .and.&
- Get_FillMouseHoleLed()) then
-
- !call Log_4("OPERATION-CODE=38")
- call Set_LatchLed(.true.)
- !call Set_UnlatchLed(.false.)
- return
- end if
-
-
-
-
-
-
- !OPERATION-CODE=39
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- Get_HookHeight() >= 27.41 .and.&
- (Get_Elevator() /= ELEVATOR_LATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STRING_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_STAND_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_LATCH_SINGLE_BEGIN .and.&
- Get_Elevator() /= ELEVATOR_UNLATCH_SINGLE_BEGIN) .and.&
- !Get_UnlatchLed() .and.&
- Get_Swing() == SWING_RAT_HOLE_END) then
-
- !call Log_4("OPERATION-CODE=39")
- call Set_LatchLed(.true.)
- !call Set_UnlatchLed(.false.)
- return
- end if
-
-
-
- call Set_LatchLed(.false.)
-
- endif
-
-
-
-
-
-
-
- end subroutine
-
- ! subroutine Subscribe_LatchLed()
- ! use COperationConditionEnumVariables
- ! use CStandRack
- ! use CUnityInputs, OnElevatorConnectionChangePosibility => OnElevatorConnectionPossibleChange
- ! use CSwingEnumVariables
- ! use CSlipsEnumVariables
- ! use CFillMouseHoleLedNotificationVariables
- ! implicit none
-
- ! call OnOperationConditionChange%Add(Evaluate_LatchLed)
- ! call OnStandRackChanged%Add(Evaluate_LatchLed)
- ! call OnElevatorConnectionChangePosibility%Add(Evaluate_LatchLed)
- ! call OnElevatorPickupChange%Add(Evaluate_LatchLed)
- ! call OnNearFloorPositionChange%Add(Evaluate_LatchLed)
- ! call OnSwingChange%Add(Evaluate_LatchLed)
- ! call OnSlipsChange%Add(Evaluate_LatchLed)
- ! call OnFillMouseHoleLedChange%Add(Evaluate_LatchLed)
-
-
- ! end subroutine
-
- end module CLatchLedNotification
|