Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triggering reference Issue #23

Closed
punithspal opened this issue Apr 10, 2024 · 4 comments
Closed

Triggering reference Issue #23

punithspal opened this issue Apr 10, 2024 · 4 comments

Comments

@punithspal
Copy link

Hello,

I have come across the following issue.

when a FrameTriggering is created, there needs to be a PduTrigerringRef and similarly when a PduTrigerring is created, there needs to be a SignalTrigerringRef .
I am doing as shown below:

canFramTrig.new_PduTriggering().set_pduTriggering(newPduTrig)
or
pduTrig.new_ISignalTriggering(sigName).set_iSignalTriggering(newISignalTrig)

The generated arxml shall be:

/CANCatalog/Cluster/CAN_Bus_Cluster/ClusterVariant/CAN_Bus_Channel/Message1_PduTrig

this is path in the generated arxml: /CANCatalog/Cluster/CAN_Bus_Cluster/ClusterVariant/CAN_Bus_Channel/Message1_PduTrig
but the required path is : /CANCatalog/Cluster/CAN_Bus_Cluster/CAN_Bus_Channel/Message1_PduTrig

The extra "ClusterVariant" is generated in the path. This gives an error in Artop and Tresos.

@girishchandranc
Copy link
Owner

Hi,
Ideally, the setting of the path works for all the Referrable elements irrespective of the element type. Please share the script to reproduce the issue.

@punithspal
Copy link
Author

punithspal commented Apr 11, 2024

newCanFramTrig.set_framePorts(framePortsList)
newCanFramTrig.set_frame(newCanFrame)

addrModeToAssign = af.CanAddressingModeType.VALUE_EXTENDED if msgAddrMode == "EXTENDED" else af.CanAddressingModeType.VALUE_STANDARD
newCanFramTrig.set_canAddressingMode(addrModeToAssign)

newCanFramTrig.set_canFrameRxBehavior(af.CanFrameRxBehaviorEnum.VALUE_ANY)
newCanFramTrig.set_canFrameTxBehavior(af.CanFrameRxBehaviorEnum.VALUE_ANY)
newCanFramTrig.set_identifier(msgID)

newPduTrig = self.CANPhysicalChannel.new_PduTriggering(msgName + "_PduTrig")
newPduTrig.set_shortName(msgName + "_PduTrig")
newPduTrig.set_iPduPorts(pduPortsList)
newPduTrig.set_iPdu(newISignalIpdu)
newCanFramTrig.new_PduTriggering().set_pduTriggering(newPduTrig)

As you can see in the code, I create a Frame triggering, then a Pdu Triggering and then reference the PduTriggering in the Frame Triggering.

All the other references work, event here it works. But the Path has a bit more than what is expected.

@girishchandranc
Copy link
Owner

@punithspal ,
It works for me with the below code.

pack = autosarfactory.new_file(path=os.path.join(resourcesDir, 'tempTest_set_Ref.arxml'), defaultArPackage='TestPackage', overWrite = True)
canChannel = pack.new_CanCluster('Can_Cluster_0').new_CanClusterVariant().new_CanPhysicalChannel('Can_channel_0')
sigTrig = canChannel.new_ISignalTriggering('sigTrig')
pduTrig = canChannel.new_PduTriggering('pduTrig')
pduTrig.new_ISignalTriggering().set_iSignalTriggering(sigTrig)
autosarfactory.save()

Please see the generated arxml file for the above code:

<?xml version='1.0' encoding='UTF-8'?>
<AUTOSAR xmlns="http://autosar.org/schema/r4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://autosar.org/schema/r4.0 AUTOSAR_00051.xsd">
  <AR-PACKAGES>
    <AR-PACKAGE>
      <SHORT-NAME>TestPackage</SHORT-NAME>
      <ELEMENTS>
        <CAN-CLUSTER>
          <SHORT-NAME>Can_Cluster_0</SHORT-NAME>
          <CAN-CLUSTER-VARIANTS>
            <CAN-CLUSTER-CONDITIONAL>
              <PHYSICAL-CHANNELS>
                <CAN-PHYSICAL-CHANNEL>
                  <SHORT-NAME>Can_channel_0</SHORT-NAME>
                  <I-SIGNAL-TRIGGERINGS>
                    <I-SIGNAL-TRIGGERING>
                      <SHORT-NAME>sigTrig</SHORT-NAME>
                    </I-SIGNAL-TRIGGERING>
                  </I-SIGNAL-TRIGGERINGS>
                  <PDU-TRIGGERINGS>
                    <PDU-TRIGGERING>
                      <SHORT-NAME>pduTrig</SHORT-NAME>
                      <I-SIGNAL-TRIGGERINGS>
                        <I-SIGNAL-TRIGGERING-REF-CONDITIONAL>
                          <I-SIGNAL-TRIGGERING-REF DEST="I-SIGNAL-TRIGGERING">/TestPackage/Can_Cluster_0/Can_channel_0/sigTrig</I-SIGNAL-TRIGGERING-REF>
                        </I-SIGNAL-TRIGGERING-REF-CONDITIONAL>
                      </I-SIGNAL-TRIGGERINGS>
                    </PDU-TRIGGERING>
                  </PDU-TRIGGERINGS>
                </CAN-PHYSICAL-CHANNEL>
              </PHYSICAL-CHANNELS>
            </CAN-CLUSTER-CONDITIONAL>
          </CAN-CLUSTER-VARIANTS>
        </CAN-CLUSTER>
      </ELEMENTS>
    </AR-PACKAGE>
  </AR-PACKAGES>
</AUTOSAR>

Could you please check if you accidentally passed "short-name" while creating the ClusterVariant? If is not a referable object and doesn't need a short-name. The current implementation checks if the short-name is not provided for referrable object, but not other way around. I will get this fixed in future releases. For the moment, could you please make sure that you don't pass short-name whole creating ClusterVariant.

Hope this helps. thanks!

girishchandranc pushed a commit that referenced this issue Apr 12, 2024
…referable elements. Added test to prove the fix works
girishchandranc added a commit that referenced this issue Apr 12, 2024
…referable elements. Added test to prove the fix works (#24)

Co-authored-by: Girish Chandran
@girishchandranc
Copy link
Owner

@punithspal I managed to fix this and the same is merged to main. So, just do a git pull and check if it works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants