Skip to content

Commit

Permalink
#27 - Reconstructed corrupted UI interface definition. Replaced init
Browse files Browse the repository at this point in the history
operation with startTest operation as is used by the version supplied
with the tool.  Basic capabilities work in Verifier.  Have not yet begun
testing workout goal capabilities.
  • Loading branch information
John Wolfe committed Jul 10, 2014
1 parent 0480ad0 commit f16b7ff
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 2,112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,15 +713,15 @@ INSERT INTO SPR_RS
VALUES ("d9d00089-99ea-429a-9af0-86fc7db383e8",
'setTargetPressed',
'',
'// Find the singleton instance of workout session, and if there is a
// goal currently executing for it, notify it that its execution
// has completed.
select any session from instances of WorkoutSession;
if ( not empty session )
select one goal related by session->Goal[R11.''is currently executing''];
if ( not empty goal )
generate Goal1:Completed to goal;
end if;
'// Find the singleton instance of workout session, and if there is a
// goal currently executing for it, notify it that its execution
// has completed.
select any session from instances of WorkoutSession;
if ( not empty session )
select one goal related by session->Goal[R11.''is currently executing''];
if ( not empty goal )
generate Goal1:Completed to goal;
end if;
end if;',
1);
INSERT INTO C_EP_PROXY
Expand Down Expand Up @@ -771,29 +771,12 @@ INSERT INTO SPR_REP
"f093414e-3df2-4f9c-a0b4-61ba8e8a6ed9");
INSERT INTO SPR_RO
VALUES ("09e055b7-c9bd-41a1-8c5f-6de32690df20",
'init',
'',
'',
1);
INSERT INTO C_EP_PROXY
VALUES ("b64e537b-ac94-4f65-90c0-8ac26c754583",
"06e358bd-8488-4092-af9c-7c359b158f4d",
-1,
'init',
'',
'../../UIInterfaces/ActionsAndData/ActionsAndData.xtuml');
INSERT INTO SPR_REP
VALUES ("5cfdef61-5f1b-424d-ae6c-9f6ab2df0c8f",
"a6656767-0e84-4db2-9507-eba9a99c58f4",
"f093414e-3df2-4f9c-a0b4-61ba8e8a6ed9");
INSERT INTO SPR_RO
VALUES ("5cfdef61-5f1b-424d-ae6c-9f6ab2df0c8f",
'startTest',
'',
'',
1);
INSERT INTO C_EP_PROXY
VALUES ("a6656767-0e84-4db2-9507-eba9a99c58f4",
VALUES ("b64e537b-ac94-4f65-90c0-8ac26c754583",
"06e358bd-8488-4092-af9c-7c359b158f4d",
-1,
'startTest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ INSERT INTO O_TFR
'',
"ba5eda7a-def5-0000-0000-000000000000",
0,
'// Create and activate an instance of a goal specified by
// the goal specification identified by the incoming parameter.
// Find the goal specification for this goal, then
// create and relate this goal to the specification
// and to the singleton workout session.
select any goalSpec from instances of GoalSpec
where ( selected.SequenceNumber == param.sequenceNumber );
create object instance goal of Goal;
relate goal to goalSpec across R9.''specified by'';
select any session from instances of WorkoutSession;
relate goal to session across R11.''is currently executing within'';
// Initialize this goal.
goal.calculateStart();
goal.isBeingAchieved = false;
// Start a timer that periodically causes evaluation of goal achievement.
create event instance evaluateEvent of Goal2:Evaluate to goal;
goal.evaluationTimer = TIM::timer_start_recurring( event_inst: evaluateEvent, microseconds: evaluationPeriod );
'// Create and activate an instance of a goal specified by
// the goal specification identified by the incoming parameter.

// Find the goal specification for this goal, then
// create and relate this goal to the specification
// and to the singleton workout session.
select any goalSpec from instances of GoalSpec
where ( selected.SequenceNumber == param.sequenceNumber );
create object instance goal of Goal;
relate goal to goalSpec across R9.''specified by'';
select any session from instances of WorkoutSession;
relate goal to session across R11.''is currently executing within'';

// Initialize this goal.
goal.calculateStart();
goal.disposition = GoalDisposition::Increase;

// Start a timer that periodically causes evaluation of goal achievement.
create event instance evaluateEvent of Goal2:Evaluate to goal;
goal.evaluationTimer = TIM::timer_start_recurring( event_inst: evaluateEvent, microseconds: evaluationPeriod );



',
1,
'',
Expand All @@ -59,18 +59,18 @@ INSERT INTO O_TFR
'',
"ba5eda7a-def5-0000-0000-000000000000",
1,
'// Based on the span type for this goal, calculate and
// store the value of the start attribute.
select one goalSpec related by self->GoalSpec[R9.''specified by''];
if ( goalSpec.SpanType == GoalSpan::Time )
select one workoutTimer related by
self->WorkoutSession[R11.''is currently executing within'']->WorkoutTimer[R8.''is timed by''];
self.start = workoutTimer.time;
elif ( goalSpec.SpanType == GoalSpan::Distance )
select one session related by self->WorkoutSession[R11.''is currently executing within''];
self.start = session.accumulatedDistance;
else
LOG::LogFailure( message: "Goal.calculateStart: Unknown Goal Span Type." );
'// Based on the span type for this goal, calculate and
// store the value of the start attribute.
select one goalSpec related by self->GoalSpec[R9.''specified by''];
if ( goalSpec.SpanType == GoalSpan::Time )
select one workoutTimer related by
self->WorkoutSession[R11.''is currently executing within'']->WorkoutTimer[R8.''is timed by''];
self.start = workoutTimer.time;
elif ( goalSpec.SpanType == GoalSpan::Distance )
select one session related by self->WorkoutSession[R11.''is currently executing within''];
self.start = session.accumulatedDistance;
else
LOG::LogFailure( message: "Goal.calculateStart: Unknown Goal Span Type." );
end if;',
1,
'',
Expand All @@ -82,33 +82,33 @@ INSERT INTO O_TFR
'',
"e153b5eb-d36e-485d-b6a4-0b55cde4ed29",
1,
'// Based on the type of goal, determine whether this one is
// currently being achieved and return a value indicating
// the disposition of the this goal.
// Find the related goal specification and workout session for this goal.
select one goalSpec related by self->GoalSpec[R9.''specified by''];
select one session related by self->WorkoutSession[R11.''is currently executing within''];
// Based on the goal criteria type, get the appropriate current value
// for comparison against the criteria (minimum and maximum).
currentValue = 0.0; // Explicit declaration
if ( goalSpec.CriteriaType == GoalCriteria::HeartRate )
currentValue = session.currentHeartRate;
elif ( goalSpec.CriteriaType == GoalCriteria::Pace )
currentValue = session.currentPace;
else
LOG::LogFailure( message: "Goal.evaluateAchievement: Unknown Goal Criteria Type." );
end if;
// Compare the current value against the criteria to calculate the return value.
goalDisposition = GoalDisposition::Achieving;
if ( currentValue < goalSpec.Minimum )
goalDisposition = GoalDisposition::Increase;
elif ( currentValue > goalSpec.Maximum )
goalDisposition = GoalDisposition::Decrease;
end if;
'// Based on the type of goal, determine whether this one is
// currently being achieved and return a value indicating
// the disposition of the this goal.

// Find the related goal specification and workout session for this goal.
select one goalSpec related by self->GoalSpec[R9.''specified by''];
select one session related by self->WorkoutSession[R11.''is currently executing within''];

// Based on the goal criteria type, get the appropriate current value
// for comparison against the criteria (minimum and maximum).
currentValue = 0.0; // Explicit declaration
if ( goalSpec.CriteriaType == GoalCriteria::HeartRate )
currentValue = session.currentHeartRate;
elif ( goalSpec.CriteriaType == GoalCriteria::Pace )
currentValue = session.currentPace;
else
LOG::LogFailure( message: "Goal.evaluateAchievement: Unknown Goal Criteria Type." );
end if;

// Compare the current value against the criteria to calculate the return value.
goalDisposition = GoalDisposition::Achieving;
if ( currentValue < goalSpec.Minimum )
goalDisposition = GoalDisposition::Increase;
elif ( currentValue > goalSpec.Maximum )
goalDisposition = GoalDisposition::Decrease;
end if;

return( goalDisposition );',
1,
'',
Expand All @@ -127,36 +127,36 @@ INSERT INTO O_TFR
'',
"ba5eda7a-def5-0000-0000-000000000000",
1,
'// Based on the span type for this goal, determine
// whether it has been completed, update achievement
// records as necessary, and advance to the next goal
// if appropriate.
select one goalSpec related by self->GoalSpec[R9.''specified by''];
// Based on the span type for the goal, get the elapsed span
// for comparison against the specified span for the goal.
elapsedSpan = 0.0; // Explicit declaration
if ( goalSpec.SpanType == GoalSpan::Distance )
select one session related by self->WorkoutSession[R11.''is currently executing within''];
elapsedSpan = session.accumulatedDistance - self.start;
elif ( goalSpec.SpanType == GoalSpan::Time )
select one workoutTimer related by
self->WorkoutSession[R11.''is currently executing within'']->WorkoutTimer[R8.''is timed by''];
elapsedSpan = workoutTimer.time - self.start;
else
LOG::LogFailure( message: "Goal.evaluateCompletion: Unknown Goal Span Type." );
end if;
// Compare the current value against the specified span to determine
// whether the execution of this workout goal is complete.
if ( elapsedSpan >= goalSpec.Span )
select one openAchievement related by self->Achievement[R14.''has open''];
if ( not empty openAchievement )
openAchievement.close();
end if;
generate Goal1:Completed to self;
end if;
'// Based on the span type for this goal, determine
// whether it has been completed, update achievement
// records as necessary, and advance to the next goal
// if appropriate.

select one goalSpec related by self->GoalSpec[R9.''specified by''];

// Based on the span type for the goal, get the elapsed span
// for comparison against the specified span for the goal.
elapsedSpan = 0.0; // Explicit declaration
if ( goalSpec.SpanType == GoalSpan::Distance )
select one session related by self->WorkoutSession[R11.''is currently executing within''];
elapsedSpan = session.accumulatedDistance - self.start;
elif ( goalSpec.SpanType == GoalSpan::Time )
select one workoutTimer related by
self->WorkoutSession[R11.''is currently executing within'']->WorkoutTimer[R8.''is timed by''];
elapsedSpan = workoutTimer.time - self.start;
else
LOG::LogFailure( message: "Goal.evaluateCompletion: Unknown Goal Span Type." );
end if;

// Compare the current value against the specified span to determine
// whether the execution of this workout goal is complete.
if ( elapsedSpan >= goalSpec.Span )
select one openAchievement related by self->Achievement[R14.''has open''];
if ( not empty openAchievement )
openAchievement.close();
end if;
generate Goal1:Completed to self;
end if;
',
1,
'',
Expand Down
Binary file not shown.
23 changes: 3 additions & 20 deletions applications/gps/GPS Watch/models/GPS Watch/Library/UI/UI.xtuml
Original file line number Diff line number Diff line change
Expand Up @@ -431,29 +431,12 @@ INSERT INTO SPR_PEP
"4bf1a145-d815-460c-a4df-745f6e8974a0");
INSERT INTO SPR_PO
VALUES ("8959a595-f737-490a-86be-acfcbe37c94a",
'init',
'',
'',
3);
INSERT INTO C_EP_PROXY
VALUES ("b64e537b-ac94-4f65-90c0-8ac26c754583",
"06e358bd-8488-4092-af9c-7c359b158f4d",
-1,
'init',
'',
'../../UIInterfaces/ActionsAndData/ActionsAndData.xtuml');
INSERT INTO SPR_PEP
VALUES ("63584eb2-357b-4daf-83e8-6d9ec6092f3f",
"a6656767-0e84-4db2-9507-eba9a99c58f4",
"4bf1a145-d815-460c-a4df-745f6e8974a0");
INSERT INTO SPR_PO
VALUES ("63584eb2-357b-4daf-83e8-6d9ec6092f3f",
'startTest',
'',
'',
3);
'generate TestCase2:start(iterations: 2) to TestCase creator;',
1);
INSERT INTO C_EP_PROXY
VALUES ("a6656767-0e84-4db2-9507-eba9a99c58f4",
VALUES ("b64e537b-ac94-4f65-90c0-8ac26c754583",
"06e358bd-8488-4092-af9c-7c359b158f4d",
-1,
'startTest',
Expand Down
Loading

0 comments on commit f16b7ff

Please sign in to comment.