|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- module CSimulationVariables
- use CVoidEventHandlerCollection
- ! use CSimulationThreads
- use CIActionReference
- ! use ifcore
- ! use ifmt
- ! use CTimer
- use CError
- use CLog3
- implicit none
- public
-
- integer, parameter :: SimulationState_Stopped = 0;
- integer, parameter :: SimulationState_Started = 1;
- integer, parameter :: SimulationState_Paused = 2;
-
- logical :: IsStopped = .false.
- logical :: IsSnapshot = .false.
- logical :: IsPortable = .false.
- integer :: IsPortableInt = 0
-
- integer :: SimulationState_old
- integer :: SimulationState
- integer :: SimulationTime
- integer :: SimulationSpeed ! 1, 2, 5, 10
-
- integer :: SleepLimit = 0
-
- integer :: TotalPumpStrokes
- real(8) :: TotalVolumePumped
- real(8) :: DistanceDrilled
-
- type(VoidEventHandlerCollection) :: OnSimulationInitialization
- type(VoidEventHandlerCollection) :: OnSimulationStart
- type(VoidEventHandlerCollection) :: OnSimulationStop
- type(VoidEventHandlerCollection) :: OnSimulationPause
- !type(VoidEventHandlerCollection) :: OnSimulationGetOutput
-
- procedure (ActionVoid), pointer :: ForceRealTimeSpeedPtr
- procedure (ActionBool), pointer :: SpeedChangePossibilityPtr
- logical :: SpeedChangePossibilityValue
-
- procedure (ActionInteger), pointer :: TotalStrokesChangedPtr
- procedure (ActionInteger), pointer :: TotalStrokesPtr
- procedure (ActionDouble), pointer :: TotalVolumePumpedPtr
- procedure (ActionDouble), pointer :: DistanceDrilledPtr
-
- ! modules...
- !BopStack
- type(VoidEventHandlerCollection) :: OnBopStackStep
- type(VoidEventHandlerCollection) :: OnBopStackStart
- type(VoidEventHandlerCollection) :: OnBopStackOutput
- type(VoidEventHandlerCollection) :: OnBopStackPause
- type(VoidEventHandlerCollection) :: OnBopStackMain
- logical :: BopStackStarted
-
- !Pumps
- type(VoidEventHandlerCollection) :: OnPump1Step
- type(VoidEventHandlerCollection) :: OnPump1Start
- type(VoidEventHandlerCollection) :: OnPump1Output
- type(VoidEventHandlerCollection) :: OnPump1Pause
- type(VoidEventHandlerCollection) :: OnPump1Main
- logical :: Pump1Started
-
- type(VoidEventHandlerCollection) :: OnPump2Step
- type(VoidEventHandlerCollection) :: OnPump2Start
- type(VoidEventHandlerCollection) :: OnPump2Output
- type(VoidEventHandlerCollection) :: OnPump2Pause
- type(VoidEventHandlerCollection) :: OnPump2Main
- logical :: Pump2Started
-
- type(VoidEventHandlerCollection) :: OnPump3Step
- type(VoidEventHandlerCollection) :: OnPump3Start
- type(VoidEventHandlerCollection) :: OnPump3Output
- type(VoidEventHandlerCollection) :: OnPump3Pause
- type(VoidEventHandlerCollection) :: OnPump3Main
- logical :: Pump3Started
-
- !ChokeControl
- type(VoidEventHandlerCollection) :: OnChokeControlStep
- type(VoidEventHandlerCollection) :: OnChokeControlStart
- type(VoidEventHandlerCollection) :: OnChokeControlOutput
- type(VoidEventHandlerCollection) :: OnChokeControlPause
- type(VoidEventHandlerCollection) :: OnChokeControlMain
- logical :: ChokeControlStarted
-
- !ROP
- type(VoidEventHandlerCollection) :: OnRopStep
- type(VoidEventHandlerCollection) :: OnRopStart
- type(VoidEventHandlerCollection) :: OnRopOutput
- type(VoidEventHandlerCollection) :: OnRopPause
- type(VoidEventHandlerCollection) :: OnRopMain
- logical :: RopStarted
-
- !RotaryTable
- type(VoidEventHandlerCollection) :: OnRotaryTableStep
- type(VoidEventHandlerCollection) :: OnRotaryTableStart
- type(VoidEventHandlerCollection) :: OnRotaryTableOutput
- type(VoidEventHandlerCollection) :: OnRotaryTablePause
- type(VoidEventHandlerCollection) :: OnRotaryTableMain
- logical :: RotaryTableStarted
-
- !Drawworks
- type(VoidEventHandlerCollection) :: OnDrawworksStep
- type(VoidEventHandlerCollection) :: OnDrawworksStart
- type(VoidEventHandlerCollection) :: OnDrawworksOutput
- type(VoidEventHandlerCollection) :: OnDrawworksPause
- type(VoidEventHandlerCollection) :: OnDrawworksMain
- logical :: DrawworksStarted
-
- !FluidFlow
- type(VoidEventHandlerCollection) :: OnFluidFlowStep
- type(VoidEventHandlerCollection) :: OnFluidFlowStart
- type(VoidEventHandlerCollection) :: OnFluidFlowOutput
- type(VoidEventHandlerCollection) :: OnFluidFlowPause
- type(VoidEventHandlerCollection) :: OnFluidFlowMain
- logical :: FluidFlowStarted
-
- !TorqueDrag
- type(VoidEventHandlerCollection) :: OnTorqueDragStep
- type(VoidEventHandlerCollection) :: OnTorqueDragStart
- type(VoidEventHandlerCollection) :: OnTorqueDragOutput
- type(VoidEventHandlerCollection) :: OnTorqueDragPause
- type(VoidEventHandlerCollection) :: OnTorqueDragMain
- logical :: TorqueDragStarted
-
-
- !TopDrive
- type(VoidEventHandlerCollection) :: OnTopDriveStep
- type(VoidEventHandlerCollection) :: OnTopDriveStart
- type(VoidEventHandlerCollection) :: OnTopDriveOutput
- type(VoidEventHandlerCollection) :: OnTopDrivePause
- type(VoidEventHandlerCollection) :: OnTopDriveMain
- logical :: TopDriveStarted
-
-
- !MudSystem
- type(VoidEventHandlerCollection) :: OnMudSystemStep
- type(VoidEventHandlerCollection) :: OnMudSystemStart
- type(VoidEventHandlerCollection) :: OnMudSystemOutput
- type(VoidEventHandlerCollection) :: OnMudSystemPause
- type(VoidEventHandlerCollection) :: OnMudSystemMain
- logical :: MudSystemStarted
-
- !PipeRams1
- type(VoidEventHandlerCollection) :: OnPipeRams1Step
- type(VoidEventHandlerCollection) :: OnPipeRams1Start
- type(VoidEventHandlerCollection) :: OnPipeRams1Output
- type(VoidEventHandlerCollection) :: OnPipeRams1Pause
- type(VoidEventHandlerCollection) :: OnPipeRams1Main
- logical :: PipeRams1Started
-
- !PipeRams2
- type(VoidEventHandlerCollection) :: OnPipeRams2Step
- type(VoidEventHandlerCollection) :: OnPipeRams2Start
- type(VoidEventHandlerCollection) :: OnPipeRams2Output
- type(VoidEventHandlerCollection) :: OnPipeRams2Pause
- type(VoidEventHandlerCollection) :: OnPipeRams2Main
- logical :: PipeRams2Started
-
- !KillLine
- type(VoidEventHandlerCollection) :: OnKillLineStep
- type(VoidEventHandlerCollection) :: OnKillLineStart
- type(VoidEventHandlerCollection) :: OnKillLineOutput
- type(VoidEventHandlerCollection) :: OnKillLinePause
- type(VoidEventHandlerCollection) :: OnKillLineMain
- logical :: KillLineStarted
-
- !ChokeLine
- type(VoidEventHandlerCollection) :: OnChokeLineStep
- type(VoidEventHandlerCollection) :: OnChokeLineStart
- type(VoidEventHandlerCollection) :: OnChokeLineOutput
- type(VoidEventHandlerCollection) :: OnChokeLinePause
- type(VoidEventHandlerCollection) :: OnChokeLineMain
- logical :: ChokeLineStarted
-
- !BlindRams
- type(VoidEventHandlerCollection) :: OnBlindRamsStep
- type(VoidEventHandlerCollection) :: OnBlindRamsStart
- type(VoidEventHandlerCollection) :: OnBlindRamsOutput
- type(VoidEventHandlerCollection) :: OnBlindRamsPause
- type(VoidEventHandlerCollection) :: OnBlindRamsMain
- logical :: BlindRamsStarted
-
- !Annular
- type(VoidEventHandlerCollection) :: OnAnnularStep
- type(VoidEventHandlerCollection) :: OnAnnularStart
- type(VoidEventHandlerCollection) :: OnAnnularOutput
- type(VoidEventHandlerCollection) :: OnAnnularPause
- type(VoidEventHandlerCollection) :: OnAnnularMain
- logical :: AnnularStarted
-
- !Geo
- type(VoidEventHandlerCollection) :: OnGeoStep
- type(VoidEventHandlerCollection) :: OnGeoStart
- type(VoidEventHandlerCollection) :: OnGeoOutput
- type(VoidEventHandlerCollection) :: OnGeoPause
- type(VoidEventHandlerCollection) :: OnGeoMain
- logical :: GeoStarted
-
-
-
-
-
- !OperationScenarios
- type(VoidEventHandlerCollection) :: OnOperationScenariosStep
- type(VoidEventHandlerCollection) :: OnOperationScenariosOutput
- type(VoidEventHandlerCollection) :: OnOperationScenariosPause
- type(VoidEventHandlerCollection) :: OnOperationScenariosMain
-
- !PathFinding
- type(VoidEventHandlerCollection) :: OnPathFindingStep
- type(VoidEventHandlerCollection) :: OnPathFindingOutput
- type(VoidEventHandlerCollection) :: OnPathFindingPause
- type(VoidEventHandlerCollection) :: OnPathFindingMain
-
- ! sample
- type(VoidEventHandlerCollection) :: OnSampleStep
- type(VoidEventHandlerCollection) :: OnSampleStart
- type(VoidEventHandlerCollection) :: OnSampleOutput
- type(VoidEventHandlerCollection) :: OnSamplePause
- type(VoidEventHandlerCollection) :: OnSampleMain
- logical :: SampleStarted
-
- !!MudFlowFillIndicator
- !type(VoidEventHandlerCollection) :: OnMudFlowFillIndicatorStep
- !type(VoidEventHandlerCollection) :: OnMudFlowFillIndicatorOutput
- !type(VoidEventHandlerCollection) :: OnMudFlowFillIndicatorMain
-
-
-
-
-
-
-
-
-
-
-
-
-
- contains
-
- ! subroutine Quit()
- ! use ifmt
- ! call ExitThread(0)
- ! end subroutine
-
- real function GetSimulationSpeedSecond()
- implicit none
- GetSimulationSpeedSecond = 1.0 / SimulationSpeed
- end function GetSimulationSpeedSecond
-
- integer function GetSimulationSpeedMilisecond()
- implicit none
- GetSimulationSpeedMilisecond = int(GetSimulationSpeedSecond()* 1000.0)
- end function GetSimulationSpeedMilisecond
-
- subroutine DrillMode_ON()
- implicit none
- call SpeedChangePossibility(.true.)
- end subroutine
-
- subroutine DrillMode_OFF()
- implicit none
- call ForceRealTimeSpeed()
- call SpeedChangePossibility(.false.)
- end subroutine
-
- subroutine ForceRealTimeSpeed()
- implicit none
- if(associated(ForceRealTimeSpeedPtr)) call ForceRealTimeSpeedPtr()
- end subroutine
-
- subroutine SpeedChangePossibility(v)
- implicit none
- logical, intent(in) :: v
- SpeedChangePossibilityValue = v
- if(associated(SpeedChangePossibilityPtr)) call SpeedChangePossibilityPtr(SpeedChangePossibilityValue)
- end subroutine
-
- subroutine SubscribeSpeedChangePossibility(a)
- !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeSpeedChangePossibility
- !DEC$ ATTRIBUTES ALIAS: 'SubscribeSpeedChangePossibility' :: SubscribeSpeedChangePossibility
- implicit none
- procedure (ActionBool) :: a
- SpeedChangePossibilityPtr => a
- end subroutine
-
- subroutine SubscribeForceRealTimeSpeed(a)
- !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeForceRealTimeSpeed
- !DEC$ ATTRIBUTES ALIAS: 'SubscribeForceRealTimeSpeed' :: SubscribeForceRealTimeSpeed
- implicit none
- procedure (ActionVoid) :: a
- ForceRealTimeSpeedPtr => a
- end subroutine
-
- subroutine SubscribeTotalStrokesChanged(a)
- !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeTotalStrokesChanged
- !DEC$ ATTRIBUTES ALIAS: 'SubscribeTotalStrokesChanged' :: SubscribeTotalStrokesChanged
- implicit none
- procedure (ActionInteger) :: a
- TotalStrokesChangedPtr => a
- end subroutine
-
- subroutine SetTotalStrokes(strokes)
- implicit none
- integer, intent(in) :: strokes
- if (TotalPumpStrokes == strokes) return
- TotalPumpStrokes = strokes
- if(associated(TotalStrokesChangedPtr)) call TotalStrokesChangedPtr(TotalPumpStrokes)
- if(associated(TotalStrokesPtr)) call TotalStrokesPtr(TotalPumpStrokes)
- end subroutine
-
- subroutine SetTotalVolumePumped(volume)
- implicit none
- real(8), intent(in) :: volume
- if (TotalVolumePumped == volume) return
- TotalVolumePumped = volume
- if(associated(TotalVolumePumpedPtr)) call TotalVolumePumpedPtr(TotalVolumePumped)
- end subroutine
-
- subroutine SetDistanceDrilled(distance)
- implicit none
- real(8), intent(in) :: distance
- if (DistanceDrilled == distance) return
- DistanceDrilled = distance
- if(associated(DistanceDrilledPtr)) call DistanceDrilledPtr(DistanceDrilled)
- end subroutine
-
- ! integer(4) function BopStackThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_bopstackthread" :: BopStackThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_BopStack
- ! call OnBopStackMain%RunAll()
- ! #endif
- ! #ifdef S_BopStack
- ! if(.not.BopStackStarted) then
- ! call OnBopStackStart%RunAll()
- ! BopStackStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnBopStackStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('BOP Stack Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnBopStackOutput%RunAll()
- ! end do
- ! call OnBopStackPause%RunAll()
- ! end do loop
- ! #endif
- ! BopStackThread = 0;
- ! call ExitThread(0)
- ! end function BopStackThread
-
- ! integer(4) function Pump1Thread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_pump1thread" :: Pump1Thread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Pump1
- ! call OnPump1Main%RunAll()
- ! #endif
- ! #ifdef S_Pump1
- ! if(.not.Pump1Started) then
- ! call OnPump1Start%RunAll()
- ! Pump1Started = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnPump1Step%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Pump 1 Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnPump1Output%RunAll()
- ! end do
- ! call OnPump1Pause%RunAll()
- ! end do loop
- ! #endif
- ! Pump1Thread = 0;
- ! call ExitThread(0)
- ! end function Pump1Thread
-
- ! integer(4) function Pump2Thread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_pump2thread" :: Pump2Thread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Pump2
- ! call OnPump2Main%RunAll()
- ! #endif
- ! #ifdef S_Pump2
- ! if(.not.Pump2Started) then
- ! call OnPump2Start%RunAll()
- ! Pump2Started = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnPump2Step%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Pump 2 Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnPump2Output%RunAll()
- ! end do
- ! call OnPump2Pause%RunAll()
- ! end do loop
- ! #endif
- ! Pump2Thread = 0;
- ! call ExitThread(0)
- ! end function Pump2Thread
-
- ! integer(4) function Pump3Thread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_pump3thread" :: Pump3Thread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Pump3
- ! call OnPump3Main%RunAll()
- ! #endif
- ! #ifdef S_Pump3
- ! if(.not.Pump3Started) then
- ! call OnPump3Start%RunAll()
- ! Pump3Started = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnPump3Step%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Pump 3 Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnPump3Output%RunAll()
- ! end do
- ! call OnPump3Pause%RunAll()
- ! end do loop
- ! #endif
- ! Pump3Thread = 0;
- ! call ExitThread(0)
- ! end function Pump3Thread
-
- ! integer(4) function ChokeControlThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_chokecontrolthread" :: ChokeControlThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_ChokeControl
- ! call OnChokeControlMain%RunAll()
- ! #endif
- ! #ifdef S_ChokeControl
- ! if(.not.ChokeControlStarted) then
- ! call OnChokeControlStart%RunAll()
- ! ChokeControlStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnChokeControlStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Choke Control Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnChokeControlOutput%RunAll()
- ! end do
- ! call OnChokeControlPause%RunAll()
- ! end do loop
- ! #endif
- ! ChokeControlThread = 0;
- ! call ExitThread(0)
- ! end function ChokeControlThread
-
- ! integer(4) function RopThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_ropthread" :: RopThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Rop
- ! call OnRopMain%RunAll()
- ! #endif
- ! #ifdef S_Rop
- ! if(.not.RopStarted) then
- ! call OnRopStart%RunAll()
- ! RopStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnRopStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('ROP Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnRopOutput%RunAll()
- ! end do
- ! call OnRopPause%RunAll()
- ! end do loop
- ! #endif
- ! RopThread = 0;
- ! call ExitThread(0)
- ! end function RopThread
-
- ! integer(4) function RotaryTableThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_rotarytablethread" :: RotaryTableThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_RotaryTable
- ! call OnRotaryTableMain%RunAll()
- ! #endif
- ! #ifdef S_RotaryTable
- ! if(.not.RotaryTableStarted) then
- ! call OnRotaryTableStart%RunAll()
- ! RotaryTableStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnRotaryTableStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Rotary Table Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnRotaryTableOutput%RunAll()
- ! end do
- ! call OnRotaryTablePause%RunAll()
- ! end do loop
- ! #endif
- ! RotaryTableThread = 0;
- ! call ExitThread(0)
- ! end function RotaryTableThread
-
- ! integer(4) function DrawworksThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_drawworksthread" :: DrawworksThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Drawworks
- ! call OnDrawworksMain%RunAll()
- ! #endif
- ! #ifdef S_Drawworks
- ! if(.not.DrawworksStarted) then
- ! call OnDrawworksStart%RunAll()
- ! DrawworksStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnDrawworksStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Drawworks Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnDrawworksOutput%RunAll()
- ! end do
- ! call OnDrawworksPause%RunAll()
- ! end do loop
- ! #endif
- ! DrawworksThread = 0;
- ! call ExitThread(0)
- ! end function DrawworksThread
-
- ! integer(4) function FluidFlowThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_fluidflowthread" :: FluidFlowThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_FluidFlow
- ! call OnFluidFlowMain%RunAll()
- ! #endif
- ! #ifdef S_FluidFlow
- ! if(.not.FluidFlowStarted) then
- ! call OnFluidFlowStart%RunAll()
- ! FluidFlowStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnFluidFlowStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Fluid Flow Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnFluidFlowOutput%RunAll()
- ! end do
- ! call OnFluidFlowPause%RunAll()
- ! end do loop
- ! #endif
- ! FluidFlowThread = 0;
- ! call ExitThread(0)
- ! end function FluidFlowThread
-
- ! integer(4) function TorqueDragThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_torquedragthread" :: TorqueDragThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_TorqueDrag
- ! call OnTorqueDragMain%RunAll()
- ! #endif
- ! #ifdef S_TorqueDrag
- ! if(.not.TorqueDragStarted) then
- ! call OnTorqueDragStart%RunAll()
- ! TorqueDragStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnTorqueDragStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Torque Drag Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnTorqueDragOutput%RunAll()
- ! end do
- ! call OnTorqueDragPause%RunAll()
- ! end do loop
- ! #endif
- ! TorqueDragThread = 0;
- ! call ExitThread(0)
- ! end function TorqueDragThread
-
-
- ! integer(4) function TopDriveThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_topdrivethread" :: TopDriveThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_TopDrive
- ! call OnTopDriveMain%RunAll()
- ! #endif
- ! #ifdef S_TopDrive
- ! if(.not.TopDriveStarted) then
- ! call OnTopDriveStart%RunAll()
- ! TopDriveStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnTopDriveStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('TopDrive Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnTopDriveOutput%RunAll()
- ! end do
- ! call OnTopDrivePause%RunAll()
- ! end do loop
- ! #endif
- ! TopDriveThread = 0;
- ! call ExitThread(0)
- ! end function TopDriveThread
-
-
- ! integer(4) function MudSystemThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_MudSystemthread" :: MudSystemThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_MudSystem
- ! call OnMudSystemMain%RunAll()
- ! #endif
- ! #ifdef S_MudSystem
- ! if(.not.MudSystemStarted) then
- ! call OnMudSystemStart%RunAll()
- ! MudSystemStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnMudSystemStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Mud System Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnMudSystemOutput%RunAll()
- ! end do
- ! call OnMudSystemPause%RunAll()
- ! end do loop
- ! #endif
- ! MudSystemThread = 0;
- ! call ExitThread(0)
- ! end function MudSystemThread
-
- ! integer(4) function PipeRams1Thread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_piperams1thread" :: PipeRams1Thread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_PipeRams1
- ! call OnPipeRams1Main%RunAll()
- ! #endif
- ! #ifdef S_PipeRams1
- ! if(.not.PipeRams1Started) then
- ! call OnPipeRams1Start%RunAll()
- ! PipeRams1Started = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnPipeRams1Step%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Pipe Rams 1 Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnPipeRams1Output%RunAll()
- ! end do
- ! call OnPipeRams1Pause%RunAll()
- ! end do loop
- ! #endif
- ! PipeRams1Thread = 0;
- ! call ExitThread(0)
- ! end function PipeRams1Thread
-
- ! integer(4) function PipeRams2Thread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_piperams2thread" :: PipeRams2Thread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_PipeRams2
- ! call OnPipeRams2Main%RunAll()
- ! #endif
- ! #ifdef S_PipeRams2
- ! if(.not.PipeRams2Started) then
- ! call OnPipeRams2Start%RunAll()
- ! PipeRams2Started = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnPipeRams2Step%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Pipe Rams 2 Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnPipeRams2Output%RunAll()
- ! end do
- ! call OnPipeRams2Pause%RunAll()
- ! end do loop
- ! #endif
- ! PipeRams2Thread = 0;
- ! call ExitThread(0)
- ! end function PipeRams2Thread
-
- ! integer(4) function KillLineThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_killlinethread" :: KillLineThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_KillLine
- ! call OnKillLineMain%RunAll()
- ! #endif
- ! #ifdef S_KillLine
- ! if(.not.KillLineStarted) then
- ! call OnKillLineStart%RunAll()
- ! KillLineStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnKillLineStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Kill Line Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnKillLineOutput%RunAll()
- ! end do
- ! call OnKillLinePause%RunAll()
- ! end do loop
- ! #endif
- ! KillLineThread = 0;
- ! call ExitThread(0)
- ! end function KillLineThread
-
- ! integer(4) function ChokeLineThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_chokelinethread" :: ChokeLineThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_ChokeLine
- ! call OnChokeLineMain%RunAll()
- ! #endif
- ! #ifdef S_ChokeLine
- ! if(.not.ChokeLineStarted) then
- ! call OnChokeLineStart%RunAll()
- ! ChokeLineStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnChokeLineStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Choke Line Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnChokeLineOutput%RunAll()
- ! end do
- ! call OnChokeLinePause%RunAll()
- ! end do loop
- ! #endif
- ! ChokeLineThread = 0;
- ! call ExitThread(0)
- ! end function ChokeLineThread
-
- ! integer(4) function BlindRamsThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_blindramsthread" :: BlindRamsThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_BlindRams
- ! call OnBlindRamsMain%RunAll()
- ! #endif
- ! #ifdef S_BlindRams
- ! if(.not.BlindRamsStarted) then
- ! call OnBlindRamsStart%RunAll()
- ! BlindRamsStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnBlindRamsStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Blind Rams Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnBlindRamsOutput%RunAll()
- ! end do
- ! call OnBlindRamsPause%RunAll()
- ! end do loop
- ! #endif
- ! BlindRamsThread = 0;
- ! call ExitThread(0)
- ! end function BlindRamsThread
-
- ! integer(4) function AnnularThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_annularthread" :: AnnularThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Annular
- ! call OnAnnularMain%RunAll()
- ! #endif
- ! #ifdef S_Annular
- ! if(.not.AnnularStarted) then
- ! call OnAnnularStart%RunAll()
- ! AnnularStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnAnnularStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Annular Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnAnnularOutput%RunAll()
- ! end do
- ! call OnAnnularPause%RunAll()
- ! end do loop
- ! #endif
- ! AnnularThread = 0;
- ! call ExitThread(0)
- ! end function AnnularThread
-
- ! integer(4) function GeoThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_geothread" :: GeoThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Geo
- ! call OnGeoMain%RunAll()
- ! #endif
- ! #ifdef S_Geo
- ! if(.not.GeoStarted) then
- ! call OnGeoStart%RunAll()
- ! GeoStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnGeoStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Geo Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnGeoOutput%RunAll()
- ! end do
- ! call OnGeoPause%RunAll()
- ! end do loop
- ! #endif
- ! GeoThread = 0;
- ! call ExitThread(0)
- ! end function GeoThread
-
-
-
- ! integer(4) function OperationScenariosThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_operationscenariosthread" :: OperationScenariosThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! call OnOperationScenariosMain%RunAll()
- ! OperationScenariosThread = 0;
- ! call ExitThread(0)
- ! end function OperationScenariosThread
-
- ! integer(4) function PathFindingThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_pathfindingthread" :: PathFindingThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! call OnPathFindingMain%RunAll()
- ! PathFindingThread = 0;
- ! call ExitThread(0)
- ! end function PathFindingThread
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ! integer(4) function SampleThread(arg)
- ! !DEC$ ATTRIBUTES STDCALL, ALIAS:"_samplethread" :: SampleThread
- ! use ifport
- ! use ifmt
- ! implicit none
- ! integer(4), pointer :: arg
- ! integer i, j
- ! integer elapsed, speed, remaining
- ! type(Timer) t
- ! #ifdef M_Sample
- ! call OnSampleMain%RunAll()
- ! #endif
- ! #ifdef S_Sample
- ! if(.not.SampleStarted) then
- ! call OnSampleStart%RunAll()
- ! SampleStarted = .true.
- ! end if
- ! loop: do
- ! if(IsStopped) call ExitThread(0)
- ! do i=1, 10
- ! if(IsStopped) call ExitThread(0)
- ! call t%Start()
- ! do j=1, SimulationSpeed
- ! if(IsStopped) call ExitThread(0)
- ! call OnSampleStep%RunAll()
- ! end do
- ! call t%Finish()
- ! elapsed = t%ElapsedTimeMs()
- ! remaining = 100 - elapsed
- ! #ifdef E_SpeedWatchdog
- ! if(elapsed > 100) call Error('Sample Module: exceeding more than 100ms interval, the time was ', elapsed)
- ! #endif
- ! if(remaining > 0 .and. i < 10) call sleepqq(remaining - SleepLimit)
- ! call OnSampleOutput%RunAll()
- ! end do
- ! call OnSamplePause%RunAll()
- ! end do loop
-
- ! #endif
- ! SampleThread = 0;
- ! call ExitThread(0)
- ! end function SampleThread
-
- end module CSimulationVariables
|