Java Reference
In-Depth Information
if (sgCurvebranch!=null)
{
sgCurvebranch.detach();
}
sgCurvebranch = new BranchGroup();
sgCurvebranch.setCapability(BranchGroup.ALLOW_DETACH);
sgCurvebranch.setPickable (false);
if (!sgbuttonaction[2]) //the waveform button is not active
{
sglast_digit = sgcurrent_digit;
if (eventId == SGINC)
{
if (sgvalue + Math.pow(10.0, sgdisplayvalue.length() - sgdigit) < 10000)
{
sgvalue += Math.pow(10.0, sgdisplayvalue.length() - sgdigit);
sgdisplayvalue = String.valueOf(sgvalue);
sgcurrent_digit = sgdisplayvalue.length();
if (sgcurrent_digit != sglast_digit) sgdigit += 1;
if (sgdigit>4) sgdigit=4;
}
}
else if (eventId == SGDEC)
{
if (sgvalue - Math.pow(10.0,sgdisplayvalue.length() - sgdigit) >= 100)
{
sgvalue -= Math.pow(10.0, sgdisplayvalue.length() - sgdigit);
sgdisplayvalue = String.valueOf(sgvalue);
sgcurrent_digit = sgdisplayvalue.length();
if (sgcurrent_digit!=sglast_digit) sgdigit -=1;
if (sgdigit<1) sgdigit=1;
}
}
}
sgdisplayvalue = String.valueOf(sgvalue);
if (sgbuttonaction[4]) //add the unit for the number
{
sgunit = „Hz“;
}
else if (sgbuttonaction[3])
{
sgunit = „mv“;
}
else if (sgbuttonaction[2])
{
if (sgsquare)
{
sgunit = „Square“;
}
else
{
sgunit = „Sine“;
Search WWH ::




Custom Search