Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [4diac-dev] Handling of user defined variable names during export

On Mon, 2020-02-03 at 08:35 +0000, Martin Melik-Merkumians wrote:
> Hi,
>
> regarding the tests for the exporter, you usually just check if the exported code is as expected. This could be then coupled in an integration test, where the test FBs will get exported and built with FORTE.
However then I think we would need also some kind of FB unit test.

Another option I have seen somewhere is to just export fragments (e.g., a for loop, an if, an ECC State) and check if the result is as expected. Not sure if
this is possible and valid here.

Cheers,
Alois


>
> Best regards,
> Martin
>
> --------------------------------------------------
> Dipl.-Ing. Martin Melik-Merkumians
> Advanced Mechatronic Systems
> Automation and Control Institute (ACIN)
> TU Wien
> DVR-Number: 0005886
>
> Gusshausstr. 27-29, room CA-05-38
> 1040 Vienna, Austria
> Phone: +43 (0)1 588 01 37688
> Fax: +43 (0)1 588 01 937688
> Email: melik-merkumians@xxxxxxxxxxxxxxxxx
> http://www.acin.tuwien.ac.at/
> --------------------------------------------------
>
> -----Ursprüngliche Nachricht-----
> Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx> Im Auftrag von Ernst Blecha
> Gesendet: Montag, 3. Februar 2020 09:15
> An: 4diac-dev@xxxxxxxxxxx
> Betreff: Re: [4diac-dev] Handling of user defined variable names during export
>
> Hi,
>
> I just looked at the lua exporter. There this has already been implemented for variables, event connections, data connections, adapters,...
> Also adding all of the prefixes is handled in one single place so the naming conventions can be changed if needed.
> I would suggest that we adapt the export for c++ to how it is handled for lua, although this change is even bigger than what i propsed earlier.
>
> As Alois already replied this will not affect monitoring, but only access inside the exported code.
>
> I would also like to add some tests for the export; yet I am not sure how to do this without adding dependencies between 4diac and the forte runtime.
>
> Best regards,
> Ernst Blecha
>
>
> --
>
> Ernst Blecha
> LIT | Cyber-Physical Systems Lab
>
> JOHANNES KEPLER
> UNIVERSITY LINZ
> Altenberger Straße 69
> LIT Open Innovation Center
> 4040 Linz, Austria
> ernst.blecha@xxxxxx
> www.jku.at
>
> > > > Martin Melik-Merkumians <Melik-Merkumians@xxxxxxxxxxxxxxxxx>
> 01/28/20 2:36 PM >>>
> > Hi,
> >
> > I am voting +1 for the proposal. With Joses remarks in mind, we should
> probably put the prefix into a String constant in case we have to change it in the future.
> > From today's view I would say var_ should work, and I don't see issues
> with it right now.
> > Best regards,
> > Martin
> > > -----Ursprüngliche Nachricht-----
> > > Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx> Im
> Auftrag von Jose Cabral
> > > Gesendet: Dienstag, 28. Januar 2020 12:04
> > > An: 4diac developer discussions <4diac-dev@xxxxxxxxxxx>
> > > Betreff: Re: [4diac-dev] Handling of user defined variable names
> during export
> > > Hi all,
> > >
> > > I just got acquainted with the ng exporter. I really like the new
> proposal. I also had issues in the past with a data input called "operator" which clashed with c++ reserved word.
> > > From what I see, the change will have the following consequences:
> > > - The Lua exporter should also be changed according to the new rule
> > > - The monitoring pluggin should be updated
> > > - All the exported FBs already present in FORTE should be
> re-generated (Caution: there are some generated ones that aren't fully
> generated)
> > > - We should start thinking in adding tests for the exporter
> > >
> > > Since this change will be big, we should be pretty sure that "var_"
> is the right choice.
> > > Regards
> > >
> > > Jose Cabral
> > >
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx>
> Im
> > > > Auftrag von Alois Zoitl
> > > > Gesendet: Dienstag, 28. Januar 2020 10:25
> > > > An: 4diac-dev@xxxxxxxxxxx
> > > > Betreff: Re: [4diac-dev] Handling of user defined variable names
> > > > during export
> > > >
> > > > Hi,
> > > >
> > > > this is an interesting point. Especially as it would finally also
> > > > solve our IN/OUT compilation problem for windows. Jose what do you
> think?
> > > > The only thing I'm not perfectly sure if there are any backwards
> > > > compatibility issues.
> > > >
> > > > Cheers,
> > > > Alois
> > > >
> > > > On Tue, 2020-01-28 at 08:55 +0100, Ernst Blecha wrote:
> > > > > Hi all,
> > > > >
> > > > > during working on the forte_ng export I came across the fact that
> > > > > all variable names are passed through without change. This might
> > > > > lead to name clashes or keyword conflicts in the future (e.g. if
> for
> > > > > implementing the for loop a temporary variable is needed, any name
> > > > > given to this variable might overlap with a variable defined by the
> user).
> > > > > I would propose adding a prefix (e.g. "var_") to all variables and
> > > > > interfaces, as this would remove the risk of unexpected name
> clashes.
> > > > >
> > > > > Best regards,
> > > > > Ernst Blecha
>
> _______________________________________________
> 4diac-dev mailing list
> 4diac-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/4diac-dev
> _______________________________________________
> 4diac-dev mailing list
> 4diac-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/4diac-dev



Back to the top