Example #1
0
/* Event function for state "last" in state set "start" */
static seqBool seqg_event_start_0_last(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 35 "../local.st"
    if (seq_delay(seqg_env, 0.1))
    {
        *seqg_pnst = 0;
        *seqg_ptrn = 0;
        return TRUE;
    }
    return FALSE;
}
Example #2
0
/* Event function for state "init" in state set "monitorEvflagTest" */
static seqBool seqg_event_monitorEvflagTest_0_init(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 30 "../monitorEvflag.st"
	if (seq_delay(seqg_env, 1.0))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
	return FALSE;
}
Example #3
0
/* Event function for state "idle" in state set "ss2" */
static seqBool seqg_event_ss2_1_idle(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 41 "../safeModeNotAssigned.st"
	if (seq_delay(seqg_env, 0.1))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 0;
		return TRUE;
	}
	return FALSE;
}
Example #4
0
/* Event function for state "done" in state set "ss1" */
static seqBool seqg_event_ss1_0_done(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 33 "../safeModeNotAssigned.st"
	if (seq_delay(seqg_env, 0.2))
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 0;
		return TRUE;
	}
	return FALSE;
}
Example #5
0
/* Event function for state "init" in state set "monitorEvflagTest" */
static seqBool E_monitorEvflagTest_0_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 30 "../monitorEvflag.st"
	if (seq_delay(ssId, 0))
	{
		*pNextState = 1;
		*pTransNum = 0;
		return TRUE;
	}
	return FALSE;
}
Example #6
0
/* Event function for state "waitForActualToEqualRequested" in state set "monitorEvflagTest" */
static seqBool seqg_event_monitorEvflagTest_0_waitForActualToEqualRequested(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 46 "../monitorEvflag.st"
	if (seq_efTestAndClear(seqg_env, actualChanged) && seqg_var->actual == seqg_var->requested)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 55 "../monitorEvflag.st"
	if (seq_delay(seqg_env, 1.0))
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #7
0
/* Event function for state "low" in state set "ss1" */
static seqBool E_ss1_0_low(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 26 "../optt.st"
	if (v > 5.0)
	{
		*pNextState = 1;
		*pTransNum = 0;
		return TRUE;
	}
# line 30 "../optt.st"
	if (seq_delay(ssId, 0))
	{
		*pNextState = 0;
		*pTransNum = 1;
		return TRUE;
	}
	return FALSE;
}
Example #8
0
/* Event function for state "high" in state set "low_high" */
static seqBool seqg_event_low_high_0_high(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 62 "../opttVar.st"
	if (seqg_var->seqg_vars_low_high.seqg_vars_high.v == 0)
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 66 "../opttVar.st"
	if (seq_delay(seqg_env, 0.3))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #9
0
/* Event function for state "done" in state set "pvGetCancel" */
static seqBool seqg_event_pvGetCancel_0_done(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 29 "../pvGetCancel.st"
	if (seqg_vars_pvGetCancel.n < 50)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 32 "../pvGetCancel.st"
	if (seq_delay(seqg_env, 0.2))
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #10
0
/* Event function for state "test" in state set "pvGetCancel" */
static seqBool seqg_event_pvGetCancel_0_test(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 47 "../pvGetCancel.st"
	if (seq_delay(seqg_env, 5.0))
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 51 "../pvGetCancel.st"
	if (seq_pvArrayGetComplete(seqg_env, 0/*x*/, 2, FALSE, NULL))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #11
0
/* Event function for state "wait_complete" in state set "pvGetAsync" */
static seqBool E_pvGetAsync_0_wait_complete(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 39 "../pvGetAsync.st"
	if (seq_delay(ssId, 0))
	{
		seq_exit(ssId);
		*pTransNum = 0;
		return TRUE;
	}
# line 42 "../pvGetAsync.st"
	if (seq_pvGetComplete(ssId, 0/*x*/))
	{
		*pNextState = 1;
		*pTransNum = 1;
		return TRUE;
	}
	return FALSE;
}
Example #12
0
/* Event function for state "RAMP_DOWN" in state set "ramp" */
static seqBool E_ramp_1_RAMP_DOWN(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 121 "../demo.st"
	if (pVar->voltage < pVar->loLimit)
	{
		*pNextState = 1;
		*pTransNum = 0;
		return TRUE;
	}
# line 125 "../demo.st"
	if (seq_delay(ssId, 0))
	{
		*pNextState = 2;
		*pTransNum = 1;
		return TRUE;
	}
	return FALSE;
}
Example #13
0
/* Event function for state "waitForActualToEqualRequested" in state set "monitorEvflagTest" */
static seqBool E_monitorEvflagTest_0_waitForActualToEqualRequested(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 46 "../monitorEvflag.st"
	if (seq_efTestAndClear(ssId, 1/*actualChanged*/) && pVar->actual == pVar->requested)
	{
		*pNextState = 1;
		*pTransNum = 0;
		return TRUE;
	}
# line 55 "../monitorEvflag.st"
	if (seq_delay(ssId, 0))
	{
		seq_exit(ssId);
		*pTransNum = 1;
		return TRUE;
	}
	return FALSE;
}
Example #14
0
/* Event function for state "check_not_set" in state set "myss" */
static seqBool seqg_event_myss_0_check_not_set(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 28 "../userfuncEf.st"
	if (seq_efTestAndClear(seqg_env, x))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 31 "../userfuncEf.st"
	if (seq_delay(seqg_env, 0.5))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #15
0
/* Event function for state "high" in state set "ss1" */
static seqBool seqg_event_ss1_0_high(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 46 "../optt.st"
	if (v == 0)
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 50 "../optt.st"
	if (seq_delay(seqg_env, 3.0))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #16
0
/* Event function for state "low" in state set "ss1" */
static seqBool seqg_event_ss1_0_low(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 26 "../optt.st"
	if (v > 5.0)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 30 "../optt.st"
	if (seq_delay(seqg_env, 2.0))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #17
0
/* Event function for state "idle" in state set "ss1" */
static seqBool seqg_event_ss1_0_idle(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 24 "../safeModeNotAssigned.st"
	if (seq_delay(seqg_env, 0.1))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 29 "../safeModeNotAssigned.st"
	if (seqg_var->v == 10)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #18
0
/* Event function for state "zero" in state set "main" */
static seqBool E_main_0_zero(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState)
{
# line 34 "../change.st"
	if (pVar->UserVar_main.n > 50)
	{
		seq_exit(ssId);
		*pTransNum = 0;
		return TRUE;
	}
# line 36 "../change.st"
	if (seq_delay(ssId, 0))
	{
		*pNextState = 0;
		*pTransNum = 1;
		return TRUE;
	}
	return FALSE;
}
Example #19
0
/* Event function for state "high" in state set "ss1" */
static seqBool seqg_event_ss1_0_high(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 32 "../sncExOpt.st"
    if (v <= 5.0)
    {
        *seqg_pnst = 0;
        *seqg_ptrn = 0;
        return TRUE;
    }
# line 36 "../sncExOpt.st"
    if (seq_delay(seqg_env, .1))
    {
        *seqg_pnst = 1;
        *seqg_ptrn = 1;
        return TRUE;
    }
    return FALSE;
}
Example #20
0
/* Event function for state "plus_e" in state set "opt_e" */
static seqBool seqg_event_opt_e_0_plus_e(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 24 "../entryOpte.st"
	if (seq_delay(seqg_env, 0.1))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 27 "../entryOpte.st"
	if (seqg_vars_opt_e.delayed1)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #21
0
/* Event function for state "low" in state set "low_high" */
static seqBool seqg_event_low_high_0_low(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 38 "../opttVar.st"
	if (seqg_var->seqg_vars_low_high.seqg_vars_low.d > 1.1)
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 42 "../opttVar.st"
	if (seq_delay(seqg_env, seqg_var->seqg_vars_low_high.seqg_vars_low.d))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #22
0
/* Event function for state "minus_e" in state set "opt_e" */
static seqBool seqg_event_opt_e_0_minus_e(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 36 "../entryOpte.st"
	if (seq_delay(seqg_env, 0.1))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 39 "../entryOpte.st"
	if (seqg_vars_opt_e.delayed2 > 1)
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #23
0
/* Event function for state "run" in state set "write" */
static seqBool seqg_event_write_4_run(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 191 "../pvGet.st"
	if (seq_efTest(seqg_env, ef_read_named) && seq_efTest(seqg_env, ef_read_anon) && seq_efTest(seqg_env, ef_read_named_sync) && seq_efTest(seqg_env, ef_read_anon_sync))
	{
		seq_exit(seqg_env);
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 193 "../pvGet.st"
	if (seq_delay(seqg_env, 0.07))
	{
		*seqg_pnst = 0;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #24
0
/* Event function for state "get" in state set "read_anon_sync" */
static seqBool seqg_event_read_anon_sync_3_get(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 154 "../pvGet.st"
	if (seqg_var->seqg_vars_read_anon_sync.n == 5)
	{
		*seqg_pnst = 2;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 157 "../pvGet.st"
	if (seq_delay(seqg_env, 0.2))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
Example #25
0
/* Event function for state "get" in state set "read_named" */
static seqBool seqg_event_read_named_0_get(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst)
{
# line 36 "../pvGet.st"
	if (seqg_var->seqg_vars_read_named.n == 5)
	{
		*seqg_pnst = 2;
		*seqg_ptrn = 0;
		return TRUE;
	}
# line 39 "../pvGet.st"
	if (seq_delay(seqg_env, 0.2))
	{
		*seqg_pnst = 1;
		*seqg_ptrn = 1;
		return TRUE;
	}
	return FALSE;
}
/* Action function for state "readingsInRangeState" in state set "lockInjectorLaserStateSet" */
static void A_lockInjectorLaserStateSet_readingsInRangeState(SS_ID ssId, struct UserVar *pVar, short transNum)
{
	switch(transNum)
	{
	case 0:
		{
		}
		return;
	case 1:
		{
# line 165 "../seqLockInjectorLaser.stt"
			seq_seqLog(ssId, "highFrequencyLimitLI < HOPR\n");
			seq_seqLog(ssId, "Readings are ok. Now attempting to find direction\n");
		}
		return;
	case 2:
		{
# line 169 "../seqLockInjectorLaser.stt"
			seq_seqLog(ssId, "Looking for valid reading!\n");
			(pVar->alpha) = 2 * (pVar->directionBO) - 1;
			(pVar->actuatorAO) = (pVar->actuatorAO) + (pVar->searchStepSizeAO) * (pVar->alpha);
# line 171 "../seqLockInjectorLaser.stt"
			seq_pvPut(ssId, 7 /* actuatorAO */, 2);
			seq_seqLog(ssId, "actuatorAO = %f\n", (pVar->actuatorAO));
# line 175 "../seqLockInjectorLaser.stt"
			if ((pVar->directionBO) == 1)
			{
				(pVar->directionBO) = 0;
			}
# line 177 "../seqLockInjectorLaser.stt"
			else
			{
				(pVar->directionBO) = 1;
			}
# line 178 "../seqLockInjectorLaser.stt"
			seq_pvPut(ssId, 6 /* directionBO */, 2);
			seq_seqLog(ssId, "alpha       = %d\n", (pVar->alpha));
			seq_seqLog(ssId, "directionBO = %d\n", (pVar->directionBO));
			(pVar->searchStepSizeAO) += (pVar->searchStepSizeAO_atEntry);
			seq_delay(ssId, 0);
		}
		return;
	}
}