Version 1.24 – release date: March 7th, 2018

We are pleased to announce the release of CPAL version 1.24. This release introduces the possibility to read and write program outputs to text files through communications channels and annotations independent from the logic of the code. The benefit is that by removing/modifying only the annotation the same code can be re-used untouched with local or remote interprocess communication (e.g., via UDP or CAN in the latter case) instead of file I/Os. As usual, this new release brings its lot of improvements in the CPAL-Editor and fixes a number of issues.

What is new

  • NEW: Startup batch of CPAL-Editor detects mismatch between 64bit OS and 32bit JVM on Windows (#392)
  • NEW: Associate .cpalws (workspace definition) with CPAL-Editor on Windows / Mac OS X (#384)
  • NEW: Process activation diagram with zooming and scrolling
  • NEW: type duration64 for signed time quantities

    
    init()
    {
      seed();
      { 
        var duration64: t1 = duration64.rand_uniform(-10s, 10s); /* positive or negative */
        var time64: t2 = time64.rand_uniform(0s, 20s9ns); /* time64 always positive */
        var duration64: d = duration64.cast(t2) - t1;
        IO.println("%t", d);
      }
    }
    
  • NEW: write structures, possibly nested, to CSV file

    
    include "annotations/hardware/hw_file.cpal"
    
    struct data {
    	time64: time;
    	uint8: u8;
    };
    
    var queue<data>: log[1];
    /* `log` stores the data that will be "pushed" into the file */ 
    
    @cpal:hardware:log
    {
      var CPAL_File: logger = {File_Access.WRITE, File_Format.CSV, "csv_text.txt" }; 
      /* CSV format is reserved for data stored as structures */
      /* opening and closing of the file is handled automatically */ 
    }
    
    processdef foo() {
      static var data: item;
      state Main {
        item.time = time64.time();
        item.u8 = item.u8+1;
        log.push(item);
      } 
      after (1s) to Exit;
     
      state Exit {
          exit(0);
    	}
      /* Actual writing to the file takes place upon the (implicit) IO.synch() 
      execution immediately after a process activation has finished */
    }	
    
    process foo: bar[100ms]();
    
  • NEW: write strings of characters to file

    
    include "annotations/hardware/hw_file.cpal"
    
    var queue<uint8>: log[1];
    /* characters stored as their ascii value */
    
    @cpal:hardware:log
    {
      var CPAL_File: logger = {File_Access.WRITE, File_Format.RAW, "text_file.txt" }; 
    }
    
    processdef foo() {
      static var uint8: item = 50; 
      state Main {
        item = item + 1;
        log.push(item);
    	/* characters are here written one by one but could be several in 
    	a row, in which case the size of `log` must be adjusted accordingly */
      } 
      after (1s) to Exit;
     
      state Exit {
          exit(0);
    	}
    }	
    
    process foo: bar[100ms]();
    

What has been fixed or changed

  • Html export of CPAL code not properly rendered offline (#189)
  • Clicking on error message in the console to corresponding line in the code editor (#209)
  • Unecessary files included in the Windows and Linux distribution of the CPAL-Editor (#386)
  • Console in CPAL-Editor windows does not set focus on latest message (#390)
  • Search and Replace in the editor does not start from current line and does not move to next hit (#389)
  • User not asked to save modified files upon quitting the editor in some cases (#132)
  • Remove variables defined in standard library from functional architecture drawing (#379)


Test coverage metrics (figures for embedded Linux platform)

  • Test code coverage for runtime engine: 88.0% (lines of code), 82.0% (functions) and 75.9% (branches)
  • Tests: parser=4018, interpreter=909, cpal2x=3642, multi-interpreter=32