NAME

CAD::Firemen::Change - Object to represant the changes of an option

VERSION

version 0.7.2

DESCRIPTION

Create a new object of CAD::Firemen::Change with

my $change = new CAD::Firemen::Change("name" => "OPTION_NAME");

afterwards, set the old and new value (or specify them already at the constructor with ("valueOld" => "OLD_VALUE", "valueNew" => "NEW_VALUE"))

$change->setValueOld("OLD_VALUE"); $change->setValueNew("NEW_VALUE");

To evaluate the changes between old and new value, just call

my $changeType = $change->evalChange();

which returns the type of the change as one of the CAD::Firemen::Change::Type. To get the color of which should be used to print the change, use

$change->highlightColor();

To evaluate the change type, you can get it with

$change->changeType();

METHODS

new

Creates a new object of type CAD::Firemen::Change. Per default, all values are empty and the change type is set to CAD::Firemen::NoChange.

You can specify values like that:

my $change = new CAD::Firemen::Change( "name" => "OPTION_NAME", "valueOld" => "VALUE_OLD", "valueNew" => "VALUE_NEW" );

setOption

Sets the option name. To read it, just use method option().

option

Returns the name of this option.

setValueOld

Sets the old value of this option. To read it use valueOld().

valueOld

Returns the old value of this option.

setValueNew

Sets the new value of this option. To read the value use valueNew().

valueNew

Returns the new value of this option.

setPossibleValuesOld

Set's the array of possible old values.

possibleValuesOld

Returns an array with old possible values.

setPossibleValuesNew

Set's the array of possible new values.

possibleValuesNew

Returns an array with new possible values.

setDefaultValueOld

Set's the old default value.

defaultValueOld

Returns the old default value.

setDefaultValueNew

Set's the new default value.

defaultValueNew

Returns the new default value.

setChangeDescription FOR INTERNAL USE ONLY!

Set's the description of this change. It set's automatically by evalChange().

changeDescription

Return the stored description, to give some more info on the current change.

evalChange

Evaluates the changes from old value to new value and sets the changeType() according to the detected change. It also evaluates changes within the possible and default values.

_setChangeType FOR INTERNAL USE ONLY!

Sets the change type of this change. But the change type is set automatically by evalChange(). Therefore the user does not need to set it. Just use changeType() to get the current type.

_addChangeType FOR INTERNAL USE ONLY!

Adds the change type to the already listed ones. Use setChangeType() to overwrite all already listed types.

But the change type is set automatically by evalChange(). Therefore the user does not need to set it. Just use changeType() to get the current type.

changeType

Returns true, if that change is of the given type. But it can be also of another type too. The change type is set automatically by evalChange() to one of the values of CAD::Firemen::Change::Type.

highlightColor

Returns the name of the color, which should be used to highlight this type of change.

All other - YELLOW Case - CYAN Path - MAGENTA

AUTHOR

Joachim Langenbach <langenbach@imw.tu-clausthal.de>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by TU Clausthal, Institut fuer Maschinenwesen.

This is free software, licensed under:

  The GNU General Public License, Version 2, June 1991