sub find_range { my $max=$_[0]; my $min=$_[1]; my $step=$_[2]; my @step_part; my $range; $dec_lolmt=0; # for avoiding positive offset in compu method any min data greater than zero is made equal to zero. if ($min>0) { $dec_lolmt=$min; $min=0; print OUT_LOG "WARNING: minimum physical value found to be positive for $name and is reduced to zero \n"; } my @step_part=split(/\//,$step); if($step_part[1]=~ /^[0-9]/) { $step_real=$step_part[0]/$step_part[1]; } else { $step_real=$step_part[0]; } # check for proper value of range could be returned or not if((!($step_real=~ /^[0-9]/))||($max==$min)||($step_real==0)||(!($step_real =~ /^-?\d/))) { print OUT_LOG "WARNING: No proper range could be determined for $name : default range returned as 255 \n"; $range = 255; } $range=($max-$min)/($step_real); # check if range is feasible or not(range cannot be less than 1) if($range<1) { print OUT_LOG "WARNING: No proper range could be determined for $name : defalult range returned as 255 \n"; $range = 255; } return($range); } #### sub read_tagdata { my $tag_start= $_[0]; #read the start of the tag my $tag_end=$_[1]; #read the end of the tag my $temp_buffer_data= $_[2]; #read the tagged line my @buffer_data_split; $tag_error=($temp_buffer_data=~ s/$tag_start/;/); $tag_error1=($temp_buffer_data=~ s/$tag_end/;/); if (($tag_error==0) || ($tag_error1==0)) { if(!($tag_start=~ /parameter/) && !($tag_start=~ /intern/) && !($tag_start=~ /out/) && !($tag_start=~ /visu/)) { print OUT_LOG "WARNING: No data found at $tag_start $tag_end for $name_data \n"; $buffer_data_split[1]="UNKNOWN DATA"; } } else { @buffer_data_split= split(/;/,$temp_buffer_data); } return($buffer_data_split[1]) }