Launch external code editor and/or store project code in cs file

Forum Home Forums New Ideas Launch external code editor and/or store project code in cs file

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7809
    zzz
    Participant

    Most of the time C# has heavy IDE support. As formula got heavier, I found it easy to make mistakes in the simple textbox editor. I think it can be easily improved with the following 2 options:
    1. write out temp file and spwan external editor process, read back temp file on process termination.
    Cons: only lightweight editor Notepad++ etc. seems reasonable, since most IDE holds several file open, the launched instanced only notifies the running instance and exits immediately.

    2. keep current database structure on server side, store function names in db, but store formula code in seperate small cs files instead of database in project folder; launch external editor to edit these cs files, repack the content of those small cs files into current db entries on configuration commit before sending to server.
    Pros: doesn’t require monitoring of launched process terminiation;
    formula code can be easily version controled by user
    formula code can be easily tested in IDE by user.
    Cons: seems ok on every aspect ?

    • This topic was modified 3 years, 4 months ago by zzz.
    • This topic was modified 3 years, 4 months ago by zzz.
    • This topic was modified 3 years, 4 months ago by zzz.
    • This topic was modified 3 years, 4 months ago by Mikhail.
    • This topic was modified 3 years, 4 months ago by Mikhail.
    • This topic was modified 3 years, 4 months ago by Mikhail.
    #7833
    Mikhail
    Moderator

    Thank you for paying attention to this question.
    To develop complex formulas I prefer using VS like here.
    I will think how to simplify editing formulas without VS.

    #7835
    Mikhail
    Moderator

    formula code can be easily tested in IDE by user.

    These small files would not be correct C# files, because in C# everything must be inside a class, but Rapid SCADA formulas must contains only properties and methods without class definition.

    #7836
    Mikhail
    Moderator

    3rd possible method (based on your idea):
    Imagine you have a project containing formulas like https://github.com/RapidScada/scada-community/tree/master/Formulas

    The Admin app would support extensions (separate DLLs) that allow adding custom features to the Admin app. We will develop an extension that extract content of a project class and inserts it in the configuration database right before uploading or by button click.

    What do you think?

    #7840
    zzz
    Participant

    Hi Mikhail, I think that’ll work. It’s just unclear how the details will be implemented. e.g. for this simple class https://github.com/RapidScada/scada-community/blob/master/Formulas/BasicFormulas/Avg.cs
    Will it be inserted as one single big entry
    Avg.cs
    or multiple ones e.g.
    Avg._SHARED_ / ._INIT_ (anything starts with _ to pin it in sorting.)
    Avg.GetOrAddTimeAvgItem
    Avg.MovAvg
    Avg.TimeAvg
    Avg.AvgStat
    Avg.AvgSum
    Avg.AvgCount
    Maybe in the next product iteration, there could be a group/source column to indicate certain group of functions use the same global variables.

    I dont think the first one has too much issuse, probably I would ignore the formula table completely.
    The reason I tought about the latter, is b/c the purpose of the formula table seem to serve a central point where users can get a overview of all the functions available. Hiding all the functions inside a few big entries seems to defeat the purpose. Also the global variable/object delare make it not possible to show function signature in that table. But this could be a improvement in the next iteration of such module.

    Just another thought, since you are showing the way to manage the formulas as a project. Maybe this module could provide an exe that can be lauched externally to trigger a import on post build event in VS or called in git commit hook script. Kind of basic IDE integration support 🙂

    #7844
    Mikhail
    Moderator

    Hi,

    I faced that if a project contains many functions, it’s hard to add a new row for each new function. I think, it’s better to have a row for a script block that solves some task. I would add content of one class to a one row.

    Maybe this module could provide an exe

    Why don’t you develop a server module (dll) that is much more flexible ))

    #7874
    zzz
    Participant

    What is the format of this database, SQLite ?

    #7876
    Mikhail
    Moderator

    XML files.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.