]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/commitdiff
Fix rpp_update_doc to update the documentation in split libraries
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 17:03:20 +0000 (19:03 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 17:03:20 +0000 (19:03 +0200)
rpp/blocks/rpp_generate_lib.m
rpp/blocks/rpp_get_blocks.m [new file with mode: 0644]
rpp/blocks/rpp_update_doc.m

index 0c06f918f2ece874ce04f7ee30994180b9d14530..36916c85d22349abb4f6f780192cd65b5f0198a6 100644 (file)
 %     http://www.mathworks.com/help/matlab/matlab_external/custom-building-mex-files.html
 
 function rpp_generate_lib()
-    target = rpp_get_target();
-    blocks = {};
-    if strcmp(target, 'rm48_hdk') || strcmp(target, 'tms570_hdk'),
-        blocks = {
-                'rpp_can_rx',
-                'rpp_can_setup',
-                'rpp_can_tx',
-                'rpp_gio_in',
-                'rpp_gio_out',
-                'rpp_hdk_ain',
-                'rpp_overrun',
-                'rpp_sci_cfg',
-                'rpp_sci_printf',
-                'rpp_sci_rx',
-                'rpp_sci_tx'
-                 };
-    end
-
+    blocks = rpp_get_blcoks()
        d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'blocks');
        cd(d)
 
diff --git a/rpp/blocks/rpp_get_blocks.m b/rpp/blocks/rpp_get_blocks.m
new file mode 100644 (file)
index 0000000..88a8905
--- /dev/null
@@ -0,0 +1,31 @@
+% RPP_GET_BLOCKS  Returns a 'list' of blocks supported by currecntly configured target.
+
+% Copyright (C) 2013-2015 Czech Technical University in Prague
+%
+% Authors:
+%     - Michal Sojka <sojkam1@fel.cvut.cz>
+%
+% This document contains proprietary information belonging to Czech
+% Technical University in Prague. Passing on and copying of this
+% document, and communication of its contents is not permitted
+% without prior written authorization.
+%
+
+function blocks = rpp_get_blocks()
+    target = rpp_get_target();
+    if strcmp(target, 'rm48_hdk') || strcmp(target, 'tms570_hdk'),
+        blocks = {
+                'rpp_can_rx',
+                'rpp_can_setup',
+                'rpp_can_tx',
+                'rpp_gio_in',
+                'rpp_gio_out',
+                'rpp_hdk_ain',
+                'rpp_overrun',
+                'rpp_sci_cfg',
+                'rpp_sci_printf',
+                'rpp_sci_rx',
+                'rpp_sci_tx'
+                 };
+    end
+end
index 0e7a5eb37ec30fac9e7b6a22b7f2775e38c8ef1e..1632493b72909b32d98c69b5fce323e7c6377521 100644 (file)
@@ -26,24 +26,28 @@ if nargin > 0,
 else
     op = 'update';
 end
-open('rpp_lib');
-set_param('rpp_lib', 'Lock', 'off');
-blocks = find_system('rpp_lib', 'Type', 'block');
+block_libs = rpp_get_blocks();
 updated = 0;
-for i=1:length(blocks),
-    block = blocks{i};
-    params = get_param(block, 'ObjectParameters');
-    fields = fieldnames(params);
+for i=1:length(block_libs),
+    block_lib = block_libs{i};
+    open_system(block_lib);
+    set_param(block_lib, 'Lock', 'off');
+    blocks = find_system(block_lib, 'Type', 'block');
+    for j=1:length(blocks),
+        block = blocks{j};
+        params = get_param(block, 'ObjectParameters');
+        fields = fieldnames(params);
 
-    disp(['Processing ' blocks{i}]);
-
-    updated = updated + process_param(op, block, 'MaskType', '--masktype');
-    updated = updated + process_param(op, block, 'MaskDescription', '--html --printdesc');
-    updated = updated + process_param(op, block, 'MaskPromptString', '--maskpromptstring');
-    updated = updated + process_param(op, block, 'MaskHelp', '--html --printhelp');
-    updated = updated + process_param(op, block, 'Name', '--name'); % Name must be changed last!!!
+        disp(['Processing ' blocks{j}]);
+        updated = updated + process_param(op, block, 'MaskType', '--masktype');
+        updated = updated + process_param(op, block, 'MaskDescription', '--html --printdesc');
+        updated = updated + process_param(op, block, 'MaskPromptString', '--maskpromptstring');
+        updated = updated + process_param(op, block, 'MaskHelp', '--html --printhelp');
+        updated = updated + process_param(op, block, 'Name', '--name'); % Name must be changed last!!!
+    end
+    set_param(block_lib, 'Lock', 'on');
+    close_system(block_lib);
 end
-set_param('rpp_lib', 'Lock', 'on');
 
 function output = run_doc_parse(fn, opts)
     % We have to unset Matlab's library path in order to run pandoc - it
@@ -65,7 +69,7 @@ function print_diff(fn, param, old, new)
     fprintf(f, '%s', new);
     fclose(f);
 
-    [rc, diff] = system(['git diff --no-index --word-diff=plain ' fnold ' ' fnnew]);
+    [rc, diff] = system(['git --no-pager diff --no-index --word-diff=plain ' fnold ' ' fnnew]);
     disp(diff);
     delete(fnold);
     delete(fnnew);