Skip to content

Issues Discovered While Testing PySysML2 with SysML v2 Camera Example #2

@j-simmons-phd

Description

@j-simmons-phd

I am testing out PySysML2 with some of the examples distributed in the 2024-09 - SysML v2 Pilot Implementation release. The example I am currently working on is the Camera Example (pulled into its own repo for ease of testing).

Observations so far.

  1. PySysML2 does not appear to leverage import statements to pull in content spread across multiple files. To address this behavior, I have added a step to combine all .sysml files into a single combined file for processing with PySysML2
  2. There appear to be a number of common key words not yet implemented in PySysML2, including private, import, and perform. See the following input and output (which can be recreated by cloning the repo above and running make.sh build.

Combined SysML Input File (CombinedCameraModel.sysml)

part def Camera {
	private import PictureTaking::*;
	
	perform action takePicture[*] :> PictureTaking::takePicture;
	
	part focusingSubsystem {
		perform takePicture.focus;
	}
	
	part imagingSubsystem {
		perform takePicture.shoot;
	}
	
}package PictureTaking {
	part def Exposure;
	
	action def Focus { out xrsl: Exposure; }
	action def Shoot { in xsf: Exposure; }	
		
	action takePicture {		
		action focus: Focus[1];
		flow focus.xrsl to shoot.xsf;
		action shoot: Shoot[1];
	}
}

PySysML2 command: pysysml2 export ./dist/CombinedCameraModel.sysml --output-dir ./dist --format json,png

PySysML2 CLI Output (e.g. errors)

ANTLR runtime and generated code versions disagree: 4.10!=4.13.2
ANTLR runtime and generated code versions disagree: 4.10!=4.13.2
line 2:1 mismatched input 'private' expecting {'}', 'actor', 'attribute', 'comment', 'connection', 'connect', 'doc', 'item', 'part', 'port', 'ref', 'in', 'out', COMMENT_LONG}
line 4:1 extraneous input 'perform' expecting {<EOF>, 'actor', 'attribute', 'comment', 'connect', 'doc', 'import', 'item', 'package', 'part', 'port', 'ref', 'use', 'in', 'out', COMMENT_LONG}
line 4:27 token recognition error at: '[*'
line 4:29 token recognition error at: ']'
line 7:2 mismatched input 'perform' expecting {'}', 'actor', 'attribute', 'comment', 'connection', 'connect', 'doc', 'item', 'part', 'port', 'ref', 'in', 'out', COMMENT_LONG}
line 11:2 mismatched input 'perform' expecting {'}', 'actor', 'attribute', 'comment', 'connection', 'connect', 'doc', 'item', 'part', 'port', 'ref', 'in', 'out', COMMENT_LONG}
line 17:1 extraneous input 'action' expecting {'}', 'actor', 'attribute', 'comment', 'connect', 'doc', 'item', 'package', 'part', 'port', 'ref', 'use', 'in', 'out', COMMENT_LONG}
line 18:1 extraneous input 'action' expecting {<EOF>, 'actor', 'attribute', 'comment', 'connect', 'doc', 'import', 'item', 'package', 'part', 'port', 'ref', 'use', 'in', 'out', COMMENT_LONG}
line 21:21 token recognition error at: '[1]'
line 23:21 token recognition error at: '[1]'
Using output directory: /home/kasm-user/Repos/sysmlv2-camera-example-tests/dist
Exporting to JSON...
Exporting to png...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions