Code Monkey home page Code Monkey logo

aircraft_config_edit's Introduction

configedit

The configuration editor, 'configedit', is a Qt based application that allows visualization of a nidas/nimbus configuration (e.g. default.xml) file.

To run the configuration editor, type: > configedit When the GUI comes up, go to File -> Open and navigate to the default.xml file you would like to edit.

Setting up your environment

In order to run configedit, you must have the following packages installed and environment variables set:

Required

> export PROJ_DIR=...
> yum install nidas
> yum install cmigits-nidas
> git clone http://github.com/NCAR/aircraft_projects projects

Required if adding a new Project via configedit

> export RAW_DATA_DIR=..
> export DATA_DIR=..

Optional (but helpful)

> export PROJECT=...
> export AIRCRAFT=...

Development environment

> yum install raf-devel
> yum install nidas-devel

Testing

> yum install gtest-devel

To run the tests, type:

> scons test

Documentation

Doxygen can ge used to generate documentation from the code, run

> doxygen Doxyfile

Then the documentation can be viewed by pointing your browser to the html/index.html file, e.g. file:////<path_to_code_checkout>/aircraft_config_edit/html/index.html.

Continuous Deployment

http://jenkins.eol.ucar.edu/jenkins/job/aircraft_configedit/

aircraft_config_edit's People

Contributors

catdewey avatar garyjg avatar janinea avatar jja avatar maclean avatar tombaltzer avatar topher800 avatar tthomas88 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aircraft_config_edit's Issues

Configwindow.cc compile warning (non-fatal) - deprecated function

configwindow.cc: In member function 'void ConfigWindow::setupModelView(QSplitter*)':
configwindow.cc:967:60: warning: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
treeview->setCurrentIndex(treeview->rootIndex().child(0,0));
^
In file included from /usr/include/qt5/QtCore/QtCore:10,
from /usr/include/qt5/QtGui/QtGuiDepends:3,
from /usr/include/qt5/QtGui/QtGui:3,
from configwindow.cc:33:
/usr/include/qt5/QtCore/qabstractitemmodel.h:455:20: note: declared here
inline QModelIndex QModelIndex::child(int arow, int acolumn) const

Clarify and help with required suffix for A2DTEMP vars

When adding a new ANALOG_NCAR card to a DSM, the A2D Temp suffix must be set in order to differentiate the A2DTEMP variable that is automatically added to each card. So users can tell which A2DTEMP var goes with which sensor, the convention is to set the suffix to match the dsm name. Reinforce this convention by automatically adding the dsm identifier as the suffix if the suffix is empty and notifying user so they can modify if desired.

DeviceValidator issues

  1. If sensor exists in DeviceValidator but device and range of the sensor in the XML do NOT match the validator, the values are replaced in the “Add Sensor” dialog when select Add/Edit a sensor. Channel and device CANNOT be set back to what you had. The only options are the validator range. Therefore once cannot add/edit sensors if the device name is not set correctly in DeviceValidator.cc ​​Eg:
-      <sensor IDREF="D_GPS" devicename="usock::30118" id="140"/>
+      <sensor IDREF="D_GPS" devicename="/dev/ttyS12" id="140" />

and in DeviceValidator:
{"D_GPS", "/dev/ttyS", 1, 12, DeviceValidator::_DeviceDefinition::SERIAL}

  • Need to modify device validator to be correct for existing sensors. (CJW, but see below)
  1. If a sensor is not in DeviceValidator (eg. HOLODEC), config_edit replaces device and channel with zeros. Need to add missing sensors. (HOLODEC, UDPSocketSensor, DSMTEMP, raf.UDPArincSensor)
  • Chris working on this, but…

Since the list of sensors you can use are based on the SensorCatalog and not the DeviceValidator list, we can't have two NovatelGPS in the Device validator without having two entries in the sensor catalog. Need this because NovatelGPS can be either a serial or a UDP instrument.

  1. Need consistency between /dev/ttyS# vs /dev/ttyCTI#. No way for users/code to tell which one they need.
  • Josh will try to hack the driver so both are ttys. Not going to happen soon.
  • Go through recent projects and make a list. A single sensor can go back and forth between ttyCTI# and ttyS# depending on which DSM it is on? eg:
XT007 -> ttyCTI# (New serial card; P-COM8 -> ttyS#
{"Novatel_GPS", "/dev/ttyS", 1, 12, DeviceValidator::_DeviceDefinition::SERIAL}

on dsm99: <sensor IDREF="Novatel_GPS" devicename="usock::30116" id="150"/>
on DSM303: <serialSensor IDREF="Novatel_GPS" devicename="/dev/ttyCTI2" id="150" suffix="_232"/>
on DSMVTB:

<serialSensor IDREF="Novatel_GPS" devicename="/dev/ttyCTI1" id="200" suffix="_VTB"/>
<serialSensor IDREF="Novatel_GPS" devicename="/dev/ttyCTI2" id="300" suffix="_VTB2"/>

Editing var DUMMY_ADS1 under ANALOG_NCAR card causes path change

If a user selects "Edit A2DVariable" for the DUMMY_ADS1 variable under the ANALOG_NCAR card for SPICULE DSM305, even if no changes are made but the user selects save rather than cancel, the calfile path in the XML is changed from PROJ_DIR to TMP_PROJ_DIR.

Noted here in case this comes up before ANALOG_NCAR card is fully deprecated.

Duplicate suffix showing in sensor view (eg _CFDC_CFDC)

This happened when editing SPICULE XML. acserver->CFDC suffix shows as _CFDC_CFDC in GUI.

There is a suffix in BOTH the sensor catalog and the sensor declaration in the XML.
To fix: Manually remove suffix from sensor catalog.

  • Fix code so when duplicates exist, the sensor declaration overwrites the sensorcatalog value. Include a msgBox to notify user this has occurred.

Figure out why windows disappear

When moving windows around my desktop, they sometimes disappear and while they show up in MAC multi-window view, they are impossible to get back onto the desktop.

Editing and saving and A2D variable causes unexpected changes to XML

[ using SPICULE XML ] dsm304->ANALOG_NCAR. Edit any A2D variable and save, and the following changes happen in default.xml:

  • Boxcar averaging parameters disappear from ANALOG_NCAR sensor:
<parameter name="filter" type="string" value="boxcar"/>
<parameter name="numpoints" type="int" value="50"/>
  • Calfile paths for GNI go from instrument/GNI to Engineering/GV_N677F, and name of cal file for CAVP changes.

- <calfile file="CAVRH_GNI.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/Instruments/GNI :${PROJ_DIR}/Configuration/cal_files/Instruments/GNI"/>
+ <calfile file="CAVRH_GNI.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/**Engineering/GV_N677F :${PROJ_DIR}/Configuration/cal_files/Engineering/GV_N677F"/>
- <calfile file="CAVT_GNI.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/Instruments/GNI: ${PROJ_DIR}/Configuration/cal_files/Instruments/GNI"/>
+ <calfile file="CAVT_GNI.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/Engineering/GV_N677F: ${PROJ_DIR}/Configuration/cal_files/Engineering/GV_N677F"/>
- <calfile file="CAVP_GNI.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/Instruments/GNI: ${PROJ_DIR}/Configuration/cal_files/Instruments/GNI"/>
+ <calfile file="CAVP.dat" path="${TMP_PROJ_DIR}/Configuration/cal_files/Engineering/GV_N677F: ${PROJ_DIR}/Configuration/cal_files/Engineering/GV_N677F"/>

Add tooltips

to help with fields where desired usage is not implicitly clear and requires a-priori knowledge.

[DMMAT additions] Once Add/Edit DMMAT working, work on these

After #9 :

Sensor menu

  • Add/Edit Sensor -> Add master sample rate?
  • A2D card sample rate -> Code the DIAMOND card the same? Talk to Josh
  • Generate filter based on sample rate. Set one sample rate for the card and one for the sample. (variable subsampling)
    -- Numpts = card rate/sample rate
    -- Only use boxcar for now.
    -- Talk to Josh
  • Add a field to enter latency. Assume latency is always 0.25, so have it there, but greyed out.
  • Save a sensor without a cal file. Have code create a basic cal file with 0,1,0 as cals.

Variable menu

  • Add ability to add/edit sensor, sample and variable parameters.
  • Modify Add/Edit DMMAT so gain and bipolar are the same for all channels
  • Have user enter once, then replicate under all vars for that sensor.

Editing any DSM in an XML with DMMAT cards intermittently fails with channel out of range

Intermittently, editing any DSM fails due to the error:

“Invalid parameter: Exception: InvalidParameterException: cvi-dsm:/dev/dmmat_a2d0: channel: value=32 is outside the range 0:31”

Channel was not set with gain/bipolar for vars under DIAMOND cards under cvi-dsm. In that case, nidas takes whatever the previous value was (could be from another sensor) and increments. If the increment gets above 31, nidas/dynld/A2DSensor.cc::validate() function throws the error.

To fix, I added “<parameter name="channel" type="int" value="0"/>” to the first variable under each DMMAT sensor.

Each new card should start at channel zero.

Se SOCRATES for an example of this.

DSM sensor with CHRONY_TRACKING_LOG entry without devicename can't be edited

If a DSM has a CHRONY_TRACKING_LOG sensor entry in the XML, the DSM entry can’t be edited with configedit. Throws error:

“ads_rack [dsm303]: Invalid parameter: dsm303:/var/log/chrony/tracking.log has same id=196713(dsm id=3,sensor id=105) as dsm303:/var/log/chrony/tracking.log”

To fix, add devicename=“/var/log/chrony/tracking.log” to each sensor line in section of XML.

  • Devicename is already in sensorcatalog, so XML doesn’t need it, but configedit does.
  • Adding a new CHRONY to a DSM adds it as a , but SPICULE and ASPIRE have them as a .
    Permanent fix: propagate devicename from sensorCatalog. Be careful to not overwrite devicename below in sensor.

See SPICULE and ASPIRE for examples of this.

Presence of suffix prevents variable from being saved

If select variable -> edit variable where the sensor or variable has a suffix defined in the XML, when try to save changes to variable, configedit crashes.

Example: None of the CFDC variables can be edited.
In sensorcatalog, CFDC sensor defines a suffix _CFDC
Then none of the variable in the CFDC definition in the site can be edited.

[Edit Variable] Fix inconsistency in CalSrc suffix

When user checks “Use Calfile” and adds _LPO to the Variable name field, CalSrc also adds _LPO and so is wrong. If user removes it from the variable name, CalSrc is then right but the variable name then doesn’t match the value in the WECAN default.xml file. What is the preferred functionality here?
Example: WECAN default.xml UHSAS variable
Possible Solution: First search for calfile with _LPO suffix. If not found, search without suffix.

Screen Shot 2021-10-14 at 7 32 09 PM

A2D S/N field in "Add Sensor" dialog doesn't seem to do anything

A2D S/N in “Add Sensor” dialog is NOT what you see in the XML. When I explicitly set it, the S/N does not show up in the xml.
Example: WECAN default.xml “Add Sensor” dialog for ANALOG_DMMAT sensor

  • ANALOG_NCAR and ANALOG_DMMAT have A2D S/N
  • S200, CDP has PMS S/N - does that work? Yes!
  • CDP: <parameter name="SerialNumber" type="string" value="CDP016"/>
  • S200: <parameter name="SerialNumber" type="string" value="PCAS0904-004"/>, but that value is not an option in the dropdown because it is not in the sensor catalog

Move hardcoded constants to a central location (config file?)

Right now, there are paths in configwindow.cc and Document.cc, sensor info in DeviceValidator.cc, path to init_project in NewProjectDialog.cc

Move stuff from DeviceValidator.cc to hardwire.h?? (serial and UDP, but not ANALOG_NCAR)
Globals.cc (whatever is in nimbus)? - put all the path’s in one file.

Disable editing A2DTEMP var on ANALOG_NCAR cards

If a user attempts to edit the A2DTEMP variable, when they save their changes they are presented with an error like "Invalid parameter: dsm304:/dev/ncar_a2d0 has duplicate sample ids: 262545" and ALL the variables under the ANALOG_NCAR card are deleted.

This is due to a logical conflict. In order to edit a variable, configedit deletes it and adds it back. The A2DTEMP variable is required on the ANALOG_NCAR cards, so it can't be deleted. When it is then added back, a duplicate entry is created and the nidas validator balks.

Add/Edit DMMAT var

After going down a few rabbit holes, decided to brute force copy addA2dVariable and insertA2DVariable and split into versions for ANALOG_NCAR and ANALOG_DMMAT. Deleting a DMMAT var now works. However, add and edit still need more tracing. Both are caught gracefully with a message box. Search for "DMMAT card not implemented yet" in AddA2DVariableComboDialog.cc and Document.cc to find where failures are preempted.

Breadcrumbs for future work:

  • Edit DMMAT: AddA2dVariableComboDialog.cc line 267 in show(): call to name() causes code to crash. name() is a function of Variable, and I suspect that DMMAT cards are not inherited from Variable. Need to find equivalent call for DMMAT. Once that is fixed, there may be other things that need fixing through line 380.
  • Add DMMAT: Document.cc line 2145 in addDSCVariable(): There are two different errors here:
  1. If highlighting a DMMAT sensor when select "Add A2DVariable", on save a duplicate sample id error is thrown. When this happened for NCAR card, it was because on add, the code deletes all the existing vars and re-adds them plus the new var. But since A2DTEMP is not allowed to be deleted, get a duplicate A2DTEMP. Behaviour looks the same here so I suspect a var isn't being deleted correctly. May or may not be related: In order to be able to add a variable while a DMMAT sensor is highlighted (because there may not be any child variable available to highlight), I had to reset the pointer to the parent sensor to be the DMMAT card. See commit #4fcd112
  2. If highlighting a variable under a DMMAT sensor when select "Add A2Dvariable", on save an out of sync error occurs. Haven't dug into this one at all yet...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.