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

Custom functions are not properly updated when loading data #389

Closed
Hugal31 opened this issue Jan 18, 2021 · 1 comment
Closed

Custom functions are not properly updated when loading data #389

Hugal31 opened this issue Jan 18, 2021 · 1 comment
Assignees
Labels

Comments

@Hugal31
Copy link
Contributor

Hugal31 commented Jan 18, 2021

When loading another data file with the same field names and same timestamp range, without erasing all the plots, the custom functions are not updated property.

The CustomFunction::calculate method is correctly called, but the function never pass the timestamp check here.

I am not sure if this is me misusing the software, or if this is a bug.

Data used for the test:

time,value1,value2
0,3,4
1,5,6
2,0,2
3,-5,0
4,-3,0

plot2.csv

time,value1,value2
0,-3,10
1,-5,-5
2,-0,-3
3,5,-5
4,3,-2

layout.xml

<?xml version='1.0' encoding='UTF-8'?>
<root version="2.3.8">
 <tabbed_widget name="Main Window" parent="main_window">
  <Tab tab_name="tab1" containers="1">
   <Container>
    <DockSplitter count="1" sizes="1" orientation="-">
     <DockArea name="...">
      <plot style="Lines" mode="TimeSeries">
       <range right="4.000000" bottom="-5.275000" top="6.275000" left="0.000000"/>
       <limitY/>
       <curve name="value1" color="#1f77b4"/>
       <curve name="value2" color="#d62728"/>
       <curve name="diff" color="#1ac938"/>
      </plot>
     </DockArea>
    </DockSplitter>
   </Container>
  </Tab>
  <currentTabIndex index="0"/>
 </tabbed_widget>
 <use_relative_time_offset enabled="1"/>
 <!-- - - - - - - - - - - - - - - -->
 <!-- - - - - - - - - - - - - - - -->
 <Plugins>
  <plugin ID="DataLoad CSV">
   <default time_axis="time"/>
  </plugin>
  <plugin ID="DataLoad ULog"/>
  <plugin ID="MQTT Subscriber"/>
  <plugin ID="UDP Server"/>
  <plugin ID="WebSocket Server"/>
  <plugin ID="ZMQ Subscriber"/>
 </Plugins>
 <!-- - - - - - - - - - - - - - - -->
 <previouslyLoaded_Datafiles>
  <fileInfo prefix="" filename="/home/user/plot1.csv">
   <selected_datasources value=""/>
   <plugin ID="DataLoad CSV">
    <default time_axis="time"/>
   </plugin>
  </fileInfo>
 </previouslyLoaded_Datafiles>
 <!-- - - - - - - - - - - - - - - -->
 <customMathEquations>
  <snippet name="diff">
   <global></global>
   <function>return value - v1
</function>
   <linkedSource>value1</linkedSource>
   <additionalSources>
    <v1>value2</v1>
   </additionalSources>
  </snippet>
 </customMathEquations>
 <snippets/>
 <!-- - - - - - - - - - - - - - - -->
</root>


@facontidavide facontidavide self-assigned this Jan 18, 2021
facontidavide added a commit that referenced this issue Jan 23, 2021
@facontidavide
Copy link
Owner

fixed. Thanks a lot for reporting 😄

facontidavide added a commit that referenced this issue Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants