andersagren
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## ArrigoFolder format This is a rough working-copy of the ArrigoFolder format at this point in time. ```xml <?xml version="1.0" encoding="utf-8"?> <EXOconfigData format="ArrigoFolder" version="2017.5.000.236"> <Object type="ArrigoFolder"> <Object type="GlobalArguments"> <Attribute name="Name">GlobalArguments</Attribute> <Attribute name="Comment">This folder contains all arguments for the Published Variable List files. The arguments can be sent to the Pvl file when it is used in run-time.</Attribute> <Object type="GlobalArgument"> <Attribute name="Name">UnnamedGlobalArgument</Attribute> <Attribute name="Title">Title</Attribute> <Attribute name="Comment">Comment</Attribute> <Attribute name="Default">Default</Attribute> <Attribute name="Suggests">Suggests</Attribute> <Attribute name="Editable">Yes</Attribute> <Attribute name="Inherit">Yes</Attribute> </Object> </Object> <Object type="PublVarFiles"> <Attribute name="Name">Published Variable List files</Attribute> <Attribute name="Comment">This folder contains all Published Variable List files for the area. Each file exposes variables with names for external applications using the EOS API.</Attribute> <Object type="PublVarFile"> <Attribute name="Name">SystemAir</Attribute> <Attribute name="File">Area:\SystemAir.Pvl</Attribute> <Attribute name="FileArguments">FileArguments</Attribute> <Attribute name="Comment">Comment</Attribute> </Object> <Object type="PublVarFile"> <Attribute name="Name">Room 1</Attribute> <Attribute name="File">Area:\Rooms.Pvl</Attribute> <Attribute name="FileArguments">{RoomNumber:1}</Attribute> <Attribute name="Comment">Comment</Attribute> </Object> <Object type="PublVarFile"> <Attribute name="Name">Room 2</Attribute> <Attribute name="File">Area:\Rooms.Pvl</Attribute> <Attribute name="FileArguments">{RoomNumber:2}</Attribute> <Attribute name="Comment">Comment</Attribute> <!-- <Attribute name="UserDescription">A user description. Should be visible in GraphQl (next sprint)</Attribute> <Attribute name="Access">Operator (this is the default, we think)(next sprint)</Attribute> --> </Object> </Object> </Object> </EXOconfigData> ``` ## Iterating Pvl files for an area UserArea contains the field `publicVariableFiles` which exposes two sub-fields; **name** and **uid**. | Field | Description | | -------- | -------- | | **name** | The name of the exoconfig object in which the file is specified (as read from the ArrigoFolder.ExoXml). <br/>The actual file reference is hidden for the user. | | **uid** | A 32 char Sha256 hash on:<br/>* Username<br/>* FileName<br/>* Area<br/>* Path (probably deprecated)<br/>* FileArguments | ESF creates an object containing the "hash based" properties and ties it into a HashMap keyed on the created `uid`. By doing this the ESF can later on retrieve the information when it is time for instantiation. And by saving the user we can also compare later on (when requesting data from the `uid`) that the passed user name is the same as the stored. *This does not work at the moment as we have no way of getting the token from a subscription.* This object also contains the actual file contents (parsed, macro'ed and argument'ed) along with advise lists etc. When a data request comes in for a `uid` the Function does the usual sanity checks before checking if the support object has a proper instance of the file behind (i.e. if it's null or not). If null, we read the file, apply arguments and macros and then return it to the paying customer. ```json { folder(id: "TGFuZHNrcm9uYQ==") { name ...on UserArea { publicVariableList { name uid } } } } ``` returns ```json { "data": { "folder": { "name": "Landskrona", "publicVariableList": [ { "name": "SystemAir", "uid": "09E221DBBE078D19D192C7AAA2DC8BE8E5B1A96FF808FE91A1A3935DC8A7CF75" }, { "name": "ReginPvl", "uid": "09E377DBBE078D19D192C7AAA2DC8BE8E5B1A96FF808FE91A1A3935DC8A7CF75" } ] } } } ``` With the **uid**, and the query `data`, you can request the rest of the static data from the pvl. ```json { data(uid:"09E377DBBE078D19D192C7AAA2DC8BE8E5B1A96FF808FE91A1A3935DC8A7CF75") { content } } ``` returns ```json { "data": { "data": { "content": { "Cwl": { "type": "PublishedVariables", "attributes": { "Name": "SystemAir", "Title": "SystemAir", "Description": "", "Comment": "" }, "children": [ { "type": "PublishedVariable", "attributes": { "Name": "Second", "Title": "Second", "Description": "Real time clock: Second (0-59)", "Unit": "s", "Variable": "((undefined))", "Writable": "Yes", "ReadAccess": "Guest", "WriteAccess": "Guest", "Comment": "", "VisualFilter": "1" } } ], "Advise": { "A": [ "0:0" ] }, "AdviseRefs": { "A": [ [ 0 ] ] }, "ElementRefs": [ [ [ 0 ], 4 ] ] } } } } } ``` ElementRefs contains a list of indexes to find the right element and attribute in the tree. Ex: [0],4 means the first child (index 0) and the fifth attribute ("variable") (index 4) in the tree The `uid` also lets you set up a subscription for updates: ```json subscription { data(uid: "09E377DBBE078D19D192C7AAA2DC8BE8E5B1A96FF808FE91A1A3935DC8A7CF75") { value path variable type timestamp } } ``` Each advise update is then delivered, one at a time, in the following format: ```json { "data": { "data": { "value": 12, "path": "Cwl.Advise.A[0]", "variable": "MyController.QSystem.Sec", "type": "Update", "timeStamp": "2019-09-26T12:00:12" } } } ``` ### Gray- and blacklisted variable When subscribing to `uid`s containing gray- or blacklisted variables, the timestamp field indicates when the variable was put in the list. Please note that graylisted variables _might_ start publishing updates if they are "resolved" at a later point in time. ## In the DataStore The DataStore (DS) has its own cache of variables. When a `read` is requested and it's a cache miss, DS fetches the variable over Wamp and creates a new DataSource in the cache (keyed on the variable (technical address)). It then returns an ISubject reference (of the DataSource) to the callee. The callee can subscribe to updates on the ISubject, and when it's no longer needed the callee just disposes it. Thanks to the internal ref counting in IObservables the DS can handle re-reads of variables about to expire just by checking if the affected DataSource still has observers or not. If a variable expires, and no one is interested in it, the backing DataSource is removed from the cache. The ISubject in the DataSource is a ReplaySubject which stores its last message (if there is one), and upon a new subscription immediately publishes it to the subscriber. ## Workflow Just because you have an `uid` doesn't mean that you just can set up a subscription directly and expect everything to work. The `uid` is created/registered in the ESF when you do a `folder ..on UserArea{ publicVariableList}` query. Once that is done you can go ahead and either get the contents of the file or setup a subscription. As long as the ESF isn't restarted you can "reuse" the uid and start a subscription directly (without the `folder` query), even between "sessions". But if the ESF doesn't know about the `uid` (or if it is invalid) you get a GraphQL error when querying either `data` or `subscription/data`. ## Questions How unique should the uid be? Forever? Something hashed based on the user? What should happen when you request data for an uid that is not instantiated in the Function? This is dependant on the answer of the question above. If the uid is longlived and we restart something the hashmap in the API (and the Function?) is destroyed. Should we the be able to use our longlived uid to directly get data or do we need to get a new uid?

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully