I don't like to have timers with small interval enabled continuously firing useless events.
So in the "cIPCmaster" class I added these two enable/disable timer lines:
Code:Private Sub tmrJobState_Timer() Static JobState As eJobState, JobPSec#, JobFSec#, Progress! T = ReadInternalType If JobState <> T.JobState Or JobPSec <> T.JobPreparedHPSec Or JobFSec <> T.JobFinishedHPSec Then JobState = T.JobState: JobPSec = T.JobPreparedHPSec: JobFSec = T.JobFinishedHPSec RaiseEvent JobStateChanged(JobState) If JobState = jobFinished Then tmrJobState.Enabled = False End If If Progress <> T.JobProgress Then Progress = T.JobProgress RaiseEvent ProgressChanged(Progress) End If End SubCode:Public Property Let JobState(ByVal RHS As eJobState) If BaseAddr = 0 Then Exit Property T = ReadInternalType T.JobState = RHS If RHS = jobPrepared Then T.JobPreparedHPSec = HPTimer: T.JobProgress = 0 WriteInternalType T If RHS = jobPrepared Then tmrJobState.Enabled = True End Property
could this lead to bad consequences ?




Reply With Quote