~cpn-gui/tapaal/bug-fixing3

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/io/TapnXmlLoader.java

  • Committer: Niels Christensen
  • Date: 2019-04-16 08:45:56 UTC
  • Revision ID: nchri13@student.aau.dk-20190416084556-9i633vapwiwz1xsg
Loading of tansport and inhibitor arcs is working

Show diffs side-by-side

added added

removed removed

Lines of Context:
729
729
 
730
730
                Arc tempArc;
731
731
 
732
 
                if (type.equals("tapnInhibitor")) {
 
732
                if (type.equals("tapnInhibitor") || type.equals("inhibitor")) {
733
733
                        tempArc = parseAndAddTimedInhibitorArc(idInput, taggedArc,
734
734
                                        inscriptionTempStorage, sourceIn, targetIn, _startx,
735
735
                                        _starty, _endx, _endy,template, constants, weight);
813
813
                if (!isColored)
814
814
                        tempArc = new TimedTransportArcComponent(new TimedInputArcComponent(
815
815
                                new TimedOutputArcComponent(_startx, _starty, _endx, _endy,     sourceIn, targetIn, 1, idInput, taggedArc),
816
 
                                inscriptionSplit[0]), Integer.parseInt(inscriptionSplit[1]), isInPreSet);
 
816
                                inscriptionTempStorage), weight.value(), isInPreSet);
817
817
                else
818
818
                        tempArc = new ColoredTransportArcComponent(new ColoredInputArcComponent(
819
819
                                new ColoredOutputArcComponent(_startx, _starty, _endx, _endy, sourceIn, targetIn, 1, expr, idInput, taggedArc),
825
825
                if (isInPreSet) {
826
826
            TimeInterval interval;
827
827
            if (!isColored)
828
 
                interval = TimeInterval.parse(inscriptionSplit[0],      constants);
 
828
                interval = TimeInterval.parse(inscriptionTempStorage,   constants);
829
829
            else {
830
830
                interval = ColoredTimeInterval.parse(inscriptionTempStorage, constants, new Vector<Color>(){{add(Color.STAR_COLOR);}});
831
831
                ctiList.add((ColoredTimeInterval) interval);
832
832
            }
833
833
                        if (postsetArcs.containsKey(targetIn)) {
834
 
                                TimedTransportArcComponent postsetTransportArc = postsetArcs.get(targetIn);
 
834
                                TimedTransportArcComponent postsetTransportArc  = postsetArcs.get(targetIn);
835
835
                                TimedPlace sourcePlace = template.model().getPlaceByName(sourceIn.getName());
836
836
                                TimedTransition trans = template.model().getTransitionByName(targetIn.getName());
837
837
                                TimedPlace destPlace = template.model().getPlaceByName(postsetTransportArc.getTarget().getName());
862
862
                                if (isColored)
863
863
                                        coloredTransportArcsTimeIntervals.put((ColoredTransportArcComponent) tempArc, ctiList);
864
864
                                else
865
 
                                        transportArcsTimeIntervals.put(tempArc, TimeInterval.parse(inscriptionSplit[0], constants)); //TODO:: exception crash
 
865
                                        transportArcsTimeIntervals.put(tempArc, TimeInterval.parse(inscriptionTempStorage, constants)); //TODO:: exception crash
866
866
                        }
867
867
                } else {
868
868
                        if (presetArcs.containsKey( sourceIn)) {
870
870
                                TimedPlace sourcePlace = template.model().getPlaceByName(presetTransportArc.getSource().getName());
871
871
                                TimedTransition trans = template.model().getTransitionByName(sourceIn.getName());
872
872
                                TimedPlace destPlace = template.model().getPlaceByName(targetIn.getName());
873
 
                Logger.log(coloredTransportArcsTimeIntervals.get(presetTransportArc));
874
873
                                TimeInterval interval = null;
875
874
                                List<ColoredTimeInterval> timeIntervals = null;
876
875
                                if (!isColored)