Ignore:
Timestamp:
10/15/12 12:30:11 (19 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Updated channel specification flags documentation in 'extend-widgets'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/doc/extend-widgets/api.htm

    r9671 r10997  
    9191input channel in the following way:</p> 
    9292 
    93 <xmp class="code">self.inputs = [("Learners", orange.Learner, self.learner, 0)] 
     93<xmp class="code">self.inputs = [("Learners", orange.Learner, self.learner, Multiple)] 
    9494</xmp> 
    9595 
    96 <p>where the last argument refers if we have a "single token channel" 
    97 (last argument should be 1, default) or a "multitoken" one (0 as a 
    98 fourth element of the list holding channel definition). For the above 
    99 declared channel, the receiving function should include an extra 
    100 argument for the ID, like:</p> 
     96<p>where the last argument refers if we have a "Single" (default if not 
     97specified) or a "Multiple" channel. For the above declared channel, the 
     98receiving function should include an extra argument for the ID, like:</p> 
    10199 
    102100<xmp class="code">def learner(self, learnertoken, tokenid): 
     
    110108would declare input channels like:</p> 
    111109 
    112 <xmp class="code">self.inputs = [("Data", orange.ExampleTable, self.maindata), ("Additional Data", orange.ExampleTable, self.otherdata)] 
     110<xmp class="code">self.inputs = [("Data", orange.ExampleTable, self.maindata), 
     111               ("Additional Data", orange.ExampleTable, self.otherdata)] 
    113112</xmp> 
    114113 
    115114<p>and we connect this widget in Orange Canvas to a sending widget 
    116115that has a single orange.ExampleTable output channel, Canvas would 
    117 bring up Set Channels dialog. There, a sending widget's channel would 
     116bring up Set Channels dialog. There, a sending widget's channel could 
    118117be connected to both receiving channels. As we would often prefer to 
    119118connect to a single (default) channel instead (still allowing user of 
    120 Orange Canvas to set up a different schema manually), we set all the 
    121 channels to which we do not want an automatic connection into a "minor 
    122 mode". We do this by the using the fifth element in the channel 
     119Orange Canvas to set up a different schema manually), we set that channel 
     120as the default. We do this by the using the fourth element in the channel 
    123121definition list, like:</p> 
    124122 
    125 <xmp class="code">self.inputs = [("Data", orange.ExampleTable, self.maindata), 
    126 ("Additional Data", orange.ExampleTable, self.otherdata, 1, 1)] 
     123<xmp class="code">self.inputs = [("Data", orange.ExampleTable, self.maindata, Default), 
     124               ("Additional Data", orange.ExampleTable, self.otherdata)] 
    127125</xmp> 
    128126 
Note: See TracChangeset for help on using the changeset viewer.