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

ENH: add find_terminal tool and EL2794 support #19

Merged
merged 5 commits into from
Feb 3, 2022

Conversation

klauer
Copy link
Collaborator

@klauer klauer commented Feb 1, 2022

find_terminal.py

This is part of the effort to better understand the library and get the EL2794 in (the latter being a comparatively simple task...)

Starting with a tool to scrape the xml files better in order to add a given terminal:

$ python find_terminals.py EL2794
EL2794 rev #x00100000
  - RxPdo
   0. Channel 1 (1 words @ 5632 mandatory fixed)
      - Output: 1 bits (BOOL)
   1. Channel 2 (1 words @ 5633 mandatory fixed)
      - Output: 1 bits (BOOL)
   2. Channel 3 (1 words @ 5634 mandatory fixed)
      - Output: 1 bits (BOOL)
   3. Channel 4 (1 words @ 5635 mandatory fixed)
      - Output: 1 bits (BOOL)
   * Mapping 'All PDOs'
     pdo_in_size=[] pdo_out_size=[1, 1, 1, 1] / not in terminals.json

Considers the different possible syncmanager mappings and sees if there's a match in terminals.json. Will be using this (or a fixed up version of it) to gather information for new terminals.

EL2794 support

  • Added EL2794 support using the above information
  • Confirmed it works with @Mbosum and Ricardo's test rail (ioc-peppex-test)

Think I'm missing anything here, @JJL772 or @mcb64 ?

@klauer klauer changed the title ENH: add find_terminal tool ENH: add find_terminal tool and EL2794 support Feb 3, 2022
@klauer klauer requested review from JJL772 and mcb64 February 3, 2022 18:30
@klauer klauer marked this pull request as ready for review February 3, 2022 18:32
Copy link
Collaborator

@mcb64 mcb64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tell me terminals.h is a generated file though. Because otherwise, NUM_TERMINALS gives me the heebie-jeebies. I'd much rather see it defined as (sizeof(g_pTerminalInfos)/sizeof(g_pTerminalInfos[0])) and no size on the g_pTerminalInfos array.

@klauer
Copy link
Collaborator Author

klauer commented Feb 3, 2022

It is, @mcb64 : https://github.com/slaclab/epics-ek9000/blob/6dedab47cad23ce7d802503ba72868667bbea3c4/ek9000App/src/scripts/Makefile#L11-L12

Though I agree letting the compiler take care of it would be preferable

@JJL772
Copy link
Member

JJL772 commented Feb 3, 2022

I suggest adding an ArraySize template like this to handle that:

template<class T, size_t N>
size_t ArraySize(T(&arr)[N]) {
    return N;
}

Should work in old C++ standards too

@klauer
Copy link
Collaborator Author

klauer commented Feb 3, 2022

I'll open an issue for the array size thing and go ahead with this one. 👍

@klauer klauer merged commit 9ab70ab into slac-epics:master Feb 3, 2022
@klauer klauer deleted the enh_el2794 branch February 3, 2022 19:54
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

Successfully merging this pull request may close these issues.

3 participants