Differences From Artifact [80ea23ec62]:

To Artifact [fb306dc90a]:


8
9
10
11
12
13
14



15
16
17
18
19
20
21
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.3  1996/08/04 20:32:28  peter
## Stopped complaint about missing lbl entry for port components
##
## Revision 1.2  1996/08/04 20:05:25  peter
## Included port components - eg SS:[1]
##
## Revision 1.1  1996/08/04 20:01:58  peter







>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4  1996/08/05 10:14:46  peter
## Made ports appear, in order, at top of component lists
##
## Revision 1.3  1996/08/04 20:32:28  peter
## Stopped complaint about missing lbl entry for port components
##
## Revision 1.2  1996/08/04 20:05:25  peter
## Included port components - eg SS:[1]
##
## Revision 1.1  1996/08/04 20:01:58  peter
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370



371
372
373
374
375
376
377
378
  else {
    process_fig()
      }
}

END {
#Print out the matlab functions
  print  sprintf("function [rbonds, rstrokes,rcomponents,rports] = %s_rbg", sys_name) > b_file;
  print  sprintf("%%[rbonds,rstrokes,rcomponents,rports] = %s_rbg", sys_name) > b_file;
  print  sprintf("%%Generated by MTT") > b_file;

  print  sprintf("function [comp_type, name, cr, arg] = %s_cmp(i)",\
		 sys_name) > c_file;
  print  sprintf("%%[comp_type, name, cr, arg] = %s_cmp", sys_name) > c_file;
  print  sprintf("%%Generated by MTT") > c_file;

  print  sprintf("rbonds = [") >> b_file;
  for (i = 1; i <= i_bond; i++)
    print  bonds[i] >> b_file;
  for (i = 1; i <= i_arrow; i++)
    print  arrows[i], "-1 -1" >> b_file;
  print  sprintf("];") >> b_file;
  
  print  sprintf("rstrokes = [") >> b_file;
  for (i = 1; i <= i_stroke; i++)
    print  strokes[i] >> b_file;
  print  sprintf("];") >> b_file;

  print  sprintf("rcomponents = [") >> b_file;
  j = 0;




# Do the port componennts, in order, first
  for (i = 1; i <= i_port_component; i++) {
    port_type = "SS";
    name = sprintf("[%1.0f]", i);
    cr   = i;
    arg  = "";

    if (length(x_port[i])==0)







|
|
|

|

|
|

|




|

|


|

|


>
>
>
|







343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
  else {
    process_fig()
      }
}

END {
#Print out the matlab functions
  printf("function [rbonds, rstrokes,rcomponents,rports] = %s_rbg\n", sys_name) > b_file;
  printf("%% [rbonds,rstrokes,rcomponents,rports] = %s_rbg\n", sys_name) > b_file;
  printf("%% Generated by MTT\n\n") > b_file;

  printf("function [comp_type, name, cr, arg, n_ports] = %s_cmp(i)\n",\
		 sys_name) > c_file;
  printf("%% [comp_type, name, cr, arg, n_ports] = %s_cmp\n", sys_name) > c_file;
  printf("%% Generated by MTT\n\n") > c_file;

  printf("rbonds = [\n") >> b_file;
  for (i = 1; i <= i_bond; i++)
    print  bonds[i] >> b_file;
  for (i = 1; i <= i_arrow; i++)
    print  arrows[i], "-1 -1" >> b_file;
  printf("];\n") >> b_file;
  
  printf("rstrokes = [\n") >> b_file;
  for (i = 1; i <= i_stroke; i++)
    print  strokes[i] >> b_file;
  printf("];\n") >> b_file;

  printf("rcomponents = [") >> b_file;
  j = 0;

# Number of ports
      printf("n_ports = %1.0f;\n\n", i_port_component) 	>> c_file;

# Do the port components, in order, first
  for (i = 1; i <= i_port_component; i++) {
    port_type = "SS";
    name = sprintf("[%1.0f]", i);
    cr   = i;
    arg  = "";

    if (length(x_port[i])==0)
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
      printf("\tcomp_type = %s%s%s;\n", q, comp_type[name], q) >> c_file;
      printf("\tname = %s%s%s;\n", q, name, q) >> c_file;
      printf("\tcr = %s%s%s;\n", q, cr, q) >> c_file;
      printf("\targ = %s%s%s;\n", q, arg, q) >> c_file;
      print "end" >> c_file
	}
  }
  print sprintf("];") >> b_file;

  print  sprintf("rports = [") >> b_file;
  for (i = 1; i <= i_port; i++)
    print  ports[i] >> b_file;
  print  sprintf("];") >> b_file;

}









|

|


|




411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
      printf("\tcomp_type = %s%s%s;\n", q, comp_type[name], q) >> c_file;
      printf("\tname = %s%s%s;\n", q, name, q) >> c_file;
      printf("\tcr = %s%s%s;\n", q, cr, q) >> c_file;
      printf("\targ = %s%s%s;\n", q, arg, q) >> c_file;
      print "end" >> c_file
	}
  }
  printf("];\n") >> b_file;

  printf("rports = [\n") >> b_file;
  for (i = 1; i <= i_port; i++)
    print  ports[i] >> b_file;
  printf("];\n") >> b_file;

}



MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]