From f2b556958b58e0dbb4a17bf344743bbe9be5d41d Mon Sep 17 00:00:00 2001
From: Rolf Bork <rbork@caltech.edu>
Date: Thu, 20 Aug 2020 09:52:05 -0500
Subject: [PATCH] - Continued updates to Parameters.pm for Parameter block
 entry checking. - Updated NEWS for changes upcoming in 4.0.2

---
 NEWS                             |  8 ++++++++
 src/epics/util/feCodeGen.pl      |  6 ++++++
 src/epics/util/lib/Parameters.pm | 11 +++++++++++
 3 files changed, 25 insertions(+)

diff --git a/NEWS b/NEWS
index c2ff98d1f..350b2b4a9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,12 @@
 ==================================================================================================
+Changes for 4.0.2
+==================================================================================================
+- RCG I/O module mapping modified to allow DAC models to appear in any order on the bus. (issue #150)
+- Fix for ANU new 'N' site setting (Issue #117)
+- Fix to rtcds stop --all to stop IOP model last
+- Various changes to clear all RCG code gcc compile warnings (Issue #147)
+- Modified Parameters.pm to perform proper checking for Parameter block entreis. (Issue #155)
+==================================================================================================
 Changes for 4.0.1
 ==================================================================================================
 - Minor fix to the daq_wiper.py script, so that it does not crash when a free size is specified.
diff --git a/src/epics/util/feCodeGen.pl b/src/epics/util/feCodeGen.pl
index aa458f032..06bf5ba55 100755
--- a/src/epics/util/feCodeGen.pl
+++ b/src/epics/util/feCodeGen.pl
@@ -111,6 +111,7 @@ $maxDioMod = pop(@mdmNum);
 # Initialize default settings.
 $sitedepwarning = 0;
 $adcmasterdepwarning = 0;
+$timemasterdepwarning = 0;
 $ifo = "dummy"; # Default value for the ifo name
 $location = "zzz"; # Default value for the location name
 $rate = 0; # In microseconds (default setting)
@@ -294,6 +295,7 @@ die unless CDS::Parser::process();
 
 close(IN);
 
+#Print warning messages if model contains Parameter block entries due for deprecation
 if(($iopModel == 1) and ($modelrate > $adcclock) and ($clock_div == 1)) 
 {
 	die "Error:\nModel rate $modelrate > ADC clock $adcclock\nFix adcclock in Param Block\n*****\n";
@@ -306,6 +308,10 @@ if($adcmasterdepwarning == 1) {
 	print WARNINGS "WARNING: The 'adcMaster=' designator in the model parameter block\n\t is scheduled for deprecation in future releases. \n";
 	print WARNINGS "*******: Please replace adcMaster=1 designator with iop_model=1 \n";
 }
+if($timemasterdepwarning == 1) {
+	print WARNINGS "WARNING: The 'time_master=' designator in the model parameter block\n\t is scheduled for deprecation in future releases. \n";
+	print WARNINGS "*******: Please replace time_master=1 designator with dolphin_time_xmit=1 \n";
+}
 
 #//	
 #// Model now consists of top level parts and single level subsystem(s). <em>Parser3.pm</em> has taken care of all part
diff --git a/src/epics/util/lib/Parameters.pm b/src/epics/util/lib/Parameters.pm
index d879fec02..80b05e574 100644
--- a/src/epics/util/lib/Parameters.pm
+++ b/src/epics/util/lib/Parameters.pm
@@ -24,6 +24,7 @@ sub parseParams {
 	#print "Split array is @sp\n";
 	for (@sp) {
 		@spp = split(/=/);
+        # Find and convert params due for deprecation in later releases
 		if (@spp == 2) {
             if ($spp[0] eq "site" ) {
                 $::sitedepwarning = 1;
@@ -33,6 +34,10 @@ sub parseParams {
                 $::adcmasterdepwarning = 1;
                 $spp[0] = "iop_model";
             }
+            if($spp[0] eq "time_master") {
+                $::timemasterdepwarning = 1;
+                $spp[0] = "dolphin_time_xmit";
+            }
             switch($spp[0])
             {
                 case  "ifo" {
@@ -280,6 +285,7 @@ sub parseParams {
                     # Specify IPC rate if lower than model rate
 				    $::ipcrate = $spp[1];
                 }
+                # Following are old options that are no longer required
                 case "biquad"
                 {
 				    $nolongerused = 1;
@@ -293,6 +299,10 @@ sub parseParams {
 				    $nolongerused = 2;
                 }
                 case "shmem_daq"
+                {
+				    $nolongerused = 2;
+                }
+                case "rfm_dma"
                 {
 				    $nolongerused = 2;
                 }
@@ -304,6 +314,7 @@ sub parseParams {
 		    }
         }
 	}
+    # Check that all required Parameter block entries have been set
     if($::ifo eq "dummy")
     {
         $errmsg = "\n************\n";
-- 
GitLab