public class SpectroBehavior
extends java.lang.Object
implements manifold.domain.Behavior
Constructor and Description |
---|
SpectroBehavior()
Constructor for class SpectroBehavior
|
Modifier and Type | Method and Description |
---|---|
void |
addTarget(java.lang.String componentName,
java.lang.Object component)
Adds the components
|
void |
askForHelp()
asks for help
|
void |
callExit()
exit the program
|
void |
checkTestTubeContents()
checks content of a test tube, and get the value
|
void |
dialHelpNecessary()
dial help
|
void |
flipSwitch(boolean isSwitchOn)
The action of flipping the switch.
|
double |
getLastMovedAngle()
Returns angle of last move
|
double |
getReading()
Gets reading
|
TestTubeFigure |
getTestTube()
Gets test tube
|
boolean |
isSwitchedOn()
Returns the status of the switch
|
void |
measure()
this method measures and display value of test tube in the sample holder
|
void |
recordLastMovedAngle(double lastMoveAngle)
records angle of the last move.
|
void |
removeTestTube()
removes the test tube from sample holder
|
void |
retractWaveDialUnUsed()
retract wavelength dial
|
boolean |
seeIfTestTubeCanBePlaced()
Sees whether the test tube can be inserted into the sample hold
|
void |
setButtonStatus(boolean buttonStatus)
Sets status of buttons
|
void |
setConditionSatisfied(double readingVal)
Sets whether a button can be clicked by measuring value
|
void |
setCovered(boolean testTubeStatus)
set the status of test tube in sample holder
|
void |
setEnlargedView(boolean enlargedView)
Sets isEnlargedView
|
void |
setInstructionForStage(int stageNo)
Sets instructions for stage
|
void |
setInstructions()
Sets instructions stage based on the position of the needle
|
void |
setLidOpen(boolean lidStatus)
Handle the relationship between status of lid and needle
|
void |
setNeedleBackToZero()
Sets needles back to zero position, both small one and large one, at the same
time
|
void |
setReading(double meterReading)
Sets absorbanceMeter reading
|
void |
setState(SpectroState spectroState)
Sets state
|
void |
setTestTube(TestTubeFigure testTubeFigure)
Sets testTube
|
void |
setWarningText1()
Warning text 1 for wrong stage
|
void |
setWarningText2()
Warning text 2 for wrong needle position
|
void |
switchNotOn()
Switch on
|
void |
takeDarkDialAction(double dialAction)
Handles rotation of Dark Dial
|
void |
takeLightDialAction(double dialAction)
Handles rotation of Light Dial
|
void |
takeWaveDialAction(double dialAction)
Handles rotation of Wavelength Dial
|
void |
testTubeHelpNecessary()
test tube help
|
void |
transformNeedle(double needleTrans)
Transform the position of needle
|
void |
undoLastCommand() |
void |
wrongDirectionRotation()
processes wrong direction rotation
|
public SpectroBehavior() throws jess.JessException
jess.JessException
public void addTarget(java.lang.String componentName, java.lang.Object component)
addTarget
in interface manifold.domain.Behavior
componentName
- the Name of the component
component the componentpublic void setState(SpectroState spectroState)
spectroState
- state of Spetropublic void setEnlargedView(boolean enlargedView)
enlargedView
- status of enlarged view (1 activated 0 non-activated)public void setButtonStatus(boolean buttonStatus)
buttonStatus
- button is activated or notpublic void flipSwitch(boolean isSwitchOn)
isSwitchOn
- the status of the switchpublic boolean isSwitchedOn()
public void setTestTube(TestTubeFigure testTubeFigure)
testTubeFigure
- public void setLidOpen(boolean lidStatus) throws jess.JessException
The status of lid has effects on the result of the experiment. If the lid is open, extra light will enter the sample holder which lowers the result
lidStatus
- the status of lidjess.JessException
public TestTubeFigure getTestTube()
public void removeTestTube()
public void takeDarkDialAction(double dialAction)
dialAction
- angle of rotationpublic void takeLightDialAction(double dialAction)
dialAction
- angle of rotationpublic void takeWaveDialAction(double dialAction)
dialAction
- angle of rotationpublic void setCovered(boolean testTubeStatus)
paramBoolean
- public boolean seeIfTestTubeCanBePlaced()
This makes the software reasonable. If the lid is close or a test tube has already been in the sample holder, the selected test tube cannot be placed.
public void recordLastMovedAngle(double lastMoveAngle)
lastMoveAngle
- angle of the last movepublic double getLastMovedAngle()
public void setReading(double meterReading)
meterReading
- reading of absorbanceMeterpublic void setInstructionForStage(int stageNo)
stageNo
- public void setInstructions() throws jess.JessException
jess.JessException
public void checkTestTubeContents()
public void setWarningText1()
public void setWarningText2()
public void setNeedleBackToZero()
public double getReading()
public void setConditionSatisfied(double readingVal)
readingVal
- public void undoLastCommand()
public void transformNeedle(double needleTrans)
public void callExit()
public void switchNotOn() throws jess.JessException
jess.JessException
public void askForHelp() throws jess.JessException
jess.JessException
public void dialHelpNecessary() throws jess.JessException
jess.JessException
public void retractWaveDialUnUsed() throws jess.JessException
jess.JessException
public void testTubeHelpNecessary() throws jess.JessException
jess.JessException
public void wrongDirectionRotation() throws jess.JessException
jess.JessException
public void measure()