Skip to content

Commit

Permalink
Merge branch 'jtsalten:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsalten authored Jul 10, 2024
2 parents c435273 + 09e3bb7 commit a424a28
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:

steps:
- name: Execute ObjectScript Quality Analysis
run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh
run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files.associations": {

"Dockerfile*": "dockerfile",
"Dockerfile*": "dockerfile"
},
"objectscript.conn" :{
"ns": "IRISAPP",
Expand Down
4 changes: 2 additions & 2 deletions src/OPNEx/IoT/Timer/Basic.cls
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ClassMethod Test(pTimeOut As %Integer = 20)
{
#dim tStop, tSlots as %Integer=0
#dim tTimer as %Integer = ##class(OPNLib.IoT.Timer).GetTimerFree(.tSlots)
#dim tStart as %Integer = $piece($h,",",2)
#dim tInit as %Integer = $piece($h,",",2)
#dim tEndMsg as %String = "##CLOSING"
#dim tPeriodMillisec as %Integer = 1000
#dim tToken as %String = "BASICTOKEN001"
Expand All @@ -27,7 +27,7 @@ ClassMethod Test(pTimeOut As %Integer = 20)
write !,"Token received....["_$zt($piece($h,",",2))_"]: "_tData

//If we receive EndMsg or reach TimeOut then Stop test
if (tData[tEndMsg)||(($p($h,",",2)-tStart) > pTimeOut)
if (tData[tEndMsg)||(($p($h,",",2)-tInit) > pTimeOut)
{
set tStop = 1
do ##class(OPNLib.IoT.Timer).UnSubscribe(,$JOB)
Expand Down
8 changes: 2 additions & 6 deletions src/OPNEx/IoT/Timer/Clocks.cls
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ ClassMethod Test(pClockTime As %Integer = 30, pCDTime As %Integer = 20, pCronoTi
{
#dim tClockSet as OPNEx.IoT.Timer.Clocks = ..%New()
#dim tTkSep as %String = tClockSet.TkSep
#dim tCnt as %Integer=0
#dim tTimer,tSlots as %Integer=0
#dim tMap

// It clears whatever other signal pending for this $JOB
do $system.Event.Clear($JOB)
Expand Down Expand Up @@ -71,7 +69,7 @@ ClassMethod Test(pClockTime As %Integer = 30, pCDTime As %Integer = 20, pCronoTi
set tClockSet.CountDownTimer = ##class(OPNLib.IoT.Timer).UnSubscribe(tClockSet.CountDownTimer,$JOB,"TMCOUNTDOWN")
set tClockSet.CronometerTimer = ##class(OPNLib.IoT.Timer).UnSubscribe(tClockSet.CronometerTimer,$JOB,"TMCRONOMETER")
set tClockSet.AdminTimer = ##class(OPNLib.IoT.Timer).UnSubscribe(tClockSet.AdminTimer,$JOB,tClockSet.AdminSignal)
quit
quit $$$OK
}

/// Stop all subscriptions for this sample. Asssuming default names for the signals
Expand All @@ -88,7 +86,6 @@ ClassMethod StopTest()
/// It keeps Waiting for signals for ever of till a pEndToken for a particular pCtrlSignal is received
Method ReceiveInfo()
{
#dim tMsg as %String=""
#dim tInfo as %List
#dim tStopToken as %Boolean=0
#dim tSignalID as %String=""
Expand Down Expand Up @@ -172,7 +169,6 @@ Method Cronometer() As %Integer
{
// This CRONOMETER is supposed to be initialized to $now() when started
#dim tInit as %Integer=$get(..Map("TMCRONOMETER","init"),0)
#dim tTimer as %Integer=$get(..Map("TMCRONOMETER","timer"),0)
#dim tTimePassed as %Integer=($p($now(),",",2) - tInit)

if tTimePassed '< $get(..Map("TMCRONOMETER","max"),0) set tTimePassed = $get(..Map("TMCRONOMETER","max"),0)
Expand All @@ -189,7 +185,7 @@ Method Cronometer() As %Integer
return tTimePassed
}

Method Display() As %String
Method Display()
{
w #
w !,!,!,!,!
Expand Down
9 changes: 2 additions & 7 deletions src/OPNEx/IoT/Timer/Sample.cls
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ClassMethod BGTest(pTasks As %Integer = 4, pToken As %String = "")
/// will creates Timers as needed
Method Test(pTasks As %Integer = 4, pToken As %String = "") As %Status
{
#dim tTaskNum, tCnt, tSlots, tTimer as %Integer=0
#dim tCnt, tSlots, tTimer as %Integer=0
#dim tTaskLabel as %String=""
#dim tStopTokenDummyTask as %String = "##STOP"
#dim tPeriod as %Integer=500
Expand Down Expand Up @@ -118,17 +118,14 @@ Method UnsubscribeAllTasks() As %Status
/// It keeps Waiting for signals for ever of till the EndToken from AdminSignal is received
Method ReceiveInfo(pTkSep As %String = ":") As %Status
{
#dim tMsg as %String=""
#dim tInfo as %List
#dim tStopToken as %Boolean=0
#dim tSignalID as %String=""

while 'tStopToken
{
set tInfo = $system.Event.WaitMsg()

//trace w !,$List(tInfo,1)_" ** "_$List(tInfo,2)


set tSignalID = $piece($List(tInfo,2),pTkSep)
if (tSignalID = ..AdminSignal)
{
Expand All @@ -137,8 +134,6 @@ Method ReceiveInfo(pTkSep As %String = ":") As %Status
}
else
{
//trace write !,$zt($p($h,",",2))_"."_$p($now(),".",2)_" ** Receiving signal to run... "_$p(tSignalID,"##")

set ..Map(..AdminSignal,"val")=tSignalID
set:tSignalID'="" ..Map(tSignalID,"val") = $method($this,$get(..Map(tSignalID,"method"),"Dummy"),$List(tInfo,2))
}
Expand Down
4 changes: 2 additions & 2 deletions src/OPNEx/IoT/Timer/SimplePeriodicTask.cls
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ClassMethod Test(pTimeLapse As %Integer = 20)
#dim tMsg as %String=""
#dim tEndMsg as %String=":##CLOSING"
#dim tTokenID as %String="BASIC"_$random(9999)
#dim tStart, tRightNow as %Decimal=$piece($now(),",",2)
#dim tInit, tRightNow as %Decimal=$piece($now(),",",2)

do $system.Event.Clear($JOB)

Expand All @@ -21,7 +21,7 @@ ClassMethod Test(pTimeLapse As %Integer = 20)
set tMsg = $system.Event.WaitMsg()
set tRightNow = $piece($now(),",",2)

set tStop = ($List(tMsg,2)[tEndMsg)||((tRightNow-tStart)>pTimeLapse)
set tStop = ($List(tMsg,2)[tEndMsg)||((tRightNow-tInit)>pTimeLapse)
if tStop
{
write !,"Stopping..... Bye!"
Expand Down

0 comments on commit a424a28

Please sign in to comment.