Articles

19.1: Enumeration


19.1: Enumeration

RFmxInstrMXLOPllFractionalMode Enumeration

Specifies whether to use fractional mode for the local oscillator (LO) phase-locked loop (PLL).

Fractional mode provides a finer frequency step resolution, but may result in non harmonic spurs. Refer to the specifications document of your device for more information about fractional mode and non harmonic spurs.

To use this method for the PXIe-5830/5831, you must first use the selector string method to specify the name of the channel you are configuring. You can configure LO1 and LO2 channels by using lo1 or lo2 as the selector string, or set the selector string to lo1, lo2 to configure both channels. You can also use RFmxInstrMX.BuildLOString utility method to create the LO String. For all other devices, the only valid value for the selector string is "" (empty string).

Note: The LO PLL Fractional Mode attribute is applicable only when using the internal LO.
Note: For the PXIe-5831 with PXIe-5653 and PXIe-5840 with PXIe-5653, this property is ignored if the PXIe-5653 is used as the LO source.

The default value is Enabled. Supported devices: PXIe-5644/5645/5646, PXIe-5830/5831/5840/5841


Custom fields with dependent enumerations

Consider this scenario: you have a custom field for Defect type Work Items named "Affected OS", of type enum, with enumeration values Linux, Windows, and OS-X. You have another custom field "OS Version", also of type enum, which holds different versions of the operating systems listed in the "Affected OS" enumeration.

By default, when your users choose Linux they would have to pick the value from a list that includes not only Linux versions, but also Windows and OS-X versions, because all these are in the "OS Version" enumeration. The list could be large, so it would be better for users if the enumeration values shown to them in the "OS Version" field were dependent upon the user's selection in the "Affected OS" field. That is, when users pick Linux, they should only be shown values like SuSE, Ubuntuetc. in the "OS Version" field. Polarion provides a feature "Dependent enum Fields" that enables administrators to easily set up this kind of usability for end users. Note that it is only for custom fields.

You can configure Dependent enum Fields both globally, and per-project. The process has 2 main steps:

Configure enumerations and map value dependency between them.

Configure custom fields of the enumeration types and map the selection dependency between them.

Configure Dependent Enumerations

The first step is to configure the necessary enumerations in Administration. For the example scenario above, you would define one enumeration containing the names of operating systems (let us say, opsystem-enum.xml ), and another containing the versions ( osversions-enum.xml ). The objective here is to create a value dependency between them. The values shown to users from the latter will depend on the value selected in the former.

Open the Work Items Enumerations topic of Administration.

Define 2 enumerations and populate them with the desired values, remembering that the value selection in one is to filter the display of values from the other,

Value selection in "parent/main" filters values in "dependent"

Parent or main enumeration.

Dependent enumeration.

Map the dependency between the enumerations. Open either of the enumerations in the editor, and use one of the 2 dependency selectors to select the other enumeration, and create a mapping of values.

This may be easiest at first if you open the enumeration whose selection filters the values from the other one. In our example, this would be the opsystem-enum.xml enumeration (because when a user selects, for example "Linux", that selection should result in showing only Linux versions from the osversions-enum.xml enumeration). Therefore, you would go to the Enumerations depending on this one section and select osversions in the list.

Now click the Add Mapping link. In the mapping dialog box, select the first value of the current enumeration in the left-hand list, and in the right-hand list select all of the dependent values that should be listed for the selected value. For example, if Linux is selected on the left, you would select Ubuntu, SuSE and CentOS on the right, as they are all valid values for Linux. Leave other values unselected.

Mapping values to show users in an enumerated list of OS versions

When a user selects this.

Show these.

Repeat this mapping for all the other values in the current enumeration, selecting only valid dependent values in the right-hand list.

After creating the necessary enumerations and mapping dependency between them, you must still create custom fields and associate them with the enumerations.

Create Dependent Custom Fields

This section explains how to create custom fields that use the enumerations described in the previous section.

Configure two custom fields for the desired Work Item type, or all types is that is what you need (Navigation: Work Items > Custom Fields). Name them in such a way that the first suggests that it is the parent or main value on which the second depends.

In our example scenario, you would create a custom field "Affected OS", of type enum, selecting the opsystem enumeration. Then you create another custom field "OS Version", also of type enum, selecting the osversions enumeration.

If you do not see the list for selecting the enumeration, enlarge the Type column by dragging its header to the right. Enlarge until you see the enumerations list and the (Configure Dependency) icon.

Click the (Configure Dependency) icon on the row of the dependent field (the field whose values you want filtered for the user). The Depends on field appears. In that field, select name of the "parent" field.

In the example scenario, you would click on the "OS Version" field, and in the Depends On field, choose Affected OS.

When you select a value in the Depends On field, the Mapping filed appears. Select the mapping you specified when configuring the enumerations. (It is possible to have more than one mapping for an enumeration pair. If there are multiple mappings, select the one you want to use for this field pair. You can optionally create a new enumeration mapping now, using the Add Mapping link, or modify the selected mapping using the Edit link.)

( Result for end users in the UI.)


Automatic type conversions

In most situations, automatic conversions will be performed for the basic numeric and string types when a Python object is used in a context requiring a C value, or vice versa. The following table summarises the conversion possibilities.

C types From Python types To Python types
[unsigned] char [unsigned] short int, long int, long int
unsigned int unsigned long [unsigned] long long int, long long
float, double, long double int, long, float float
char* str/bytes str/bytes [1]
struct dict
[1]The conversion is to/from str for Python 2.x, and bytes for Python 3.x.

Caveats when using a Python string in a C context

You need to be careful when using a Python string in a context expecting a char* . In this situation, a pointer to the contents of the Python string is used, which is only valid as long as the Python string exists. So you need to make sure that a reference to the original Python string is held for as long as the C string is needed. If you can’t guarantee that the Python string will live long enough, you will need to copy the C string.

Cython detects and prevents some mistakes of this kind. For instance, if you attempt something like:

then Cython will produce the error message Obtaining char* from temporary Python value . The reason is that concatenating the two Python strings produces a new Python string object that is referenced only by a temporary internal variable that Cython generates. As soon as the statement has finished, the temporary variable will be decrefed and the Python string deallocated, leaving s dangling. Since this code could not possibly work, Cython refuses to compile it.

The solution is to assign the result of the concatenation to a Python variable, and then obtain the char* from that, i.e.:

It is then your responsibility to hold the reference p for as long as necessary.

Keep in mind that the rules used to detect such errors are only heuristics. Sometimes Cython will complain unnecessarily, and sometimes it will fail to detect a problem that exists. Ultimately, you need to understand the issue and be careful what you do.


Examples

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. Both the control and repository item are shown below.

EnumPropertyEditor

Control: EnumEdit - a descendant of the XtraEditors Library’s ImageComboBoxEdit editor.

Repository Item: RepositoryItemEnumEdit - a descendant of the XtraEditors Library’s RepositoryItemButtonEdit item.

Used for enumeration type properties by default.

You can specify images for combo box items. This Property Editor uses the EnumDescriptor class to get images and localized item captions. Refer to the How to: Set Images and Captions for Enumeration Values topic for details.

Use Alt + Down Arrow to expand the EnumEdit‘s drop-down window.

EnumIntPropertyEditor<TEnum>

Control: EnumIntEdit - a descendant of the XtraEditors Library’s ImageComboBoxEdit editor.

Repository Item: RepositoryItemEnumIntEdit - a descendant of the XtraEditors Library’s RepositoryItemImageComboBox item.

The base class for custom WinForms Property Editors, intended to display integer properties as enumerations.

Note that you cannot directly assign this Property Editor type to the BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.PropertyEditorType property in the Model Editor. Instead, inherit this Property Editor and set the TEnum generic parameter to the enumeration type that is mapped to the current integer property. Then, you can set this Property Editor type for the PropertyEditorType property. Refer to the How to: Display an Integer Property as an Enumeration topic for more information.


How to: Show Values of Enumeration in CheckedComboBoxEdit

The following example shows how to edit bit fields (a set of flags) in a CheckedComboBoxEdit control.

The control displays values of a custom MyColors enum, which has five simple flags (None through Yellow) and one combined flag (Green). Combined flags are not supported by the CheckedComboBoxEdit control. Items that correspond to these flags must be manually removed from the RepositoryItemCheckedComboBoxEdit.Items collection (see the removeCombinedFlags method which performs this operation).

The RepositoryItemCheckedComboBoxEdit.SetFlags method populates the RepositoryItemCheckedComboBoxEdit.Items collection with items corresponding to all available flags (except for a flag with a zero value). Then, the removeCombinedFlags method is called to remove items corresponding to combined flags. Finally, the editor’s initial value is specified using the CheckedComboBoxEdit.SetEditValue method.

The following image shows the result:

Note that the Green flag is not present in the dropdown list, although you can set this flag to the control’s value.


You can use the ImageNameAttribute to set the image that represents an enumeration value in a UI. Apply this attribute to the required enumeration values and specify the images to be used:

  • Use either SVG or raster images for all items in one collection. When using SVG and raster images simultaneously, an enumeration property editor can fail to show certain images. In this case, make sure image files for all entries have the same format and check the application’s Log File for an additional diagnostic message the enumeration property editor recorded.
  • ASP.NET Core Blazor applications do not show images for enumeration values.

Use the XafDisplayNameAttribute to set the display caption that represents an enumeration value in a UI. Apply this attribute to the required enumeration values and specify the caption to be used:


19.1: Enumeration

Total number of pages in the PDF document.

Name of the Polarion product used to export the PDF document.

Version of the Polarion product used to export the PDF document.

ID of the project from which the content was exported to PDF.

Name of the project from which the content was exported to PDF.

System ID of the space from which the content was exported to PDF.

Title of the space from which the content was exported to PDF.

Date when content was created in Polarion.

User name of the user who created the content in Polarion.

Date when the content was past updated in Polarion .

User name of the user who last updated the content in Polarion.

Date when the PDF document was exported.

User name of the user who exported the content to PDF.

For use when exporting revision comparison of a Document to PDF. This renders the revision number of the older of 2 compared revisions.

For use when exporting revision comparison of a Document to PDF. This renders the revision number of the newer of 2 compared revisions.


Freedom of Press under Article 19 (1) (a) of the Constitution

In the landmark case of Maneka Gandhi v. Union of India[1]Bhagwati, J. had emphasized on the freedom of speech and expression in the following words:

Democracy is based essentially on free debate and open discussion. If democracy means government of the people by the people, it is obvious that every citizen must be entitled to participate in the democratic process and in order to enable him to intelligently exercise his right of making a choice, free and general discussion of public matters is absolutely essential.”

Freedom of speech is thus, the bulwark of any democratic government. It is regarded as the first condition of liberty. In a democracy, freedom of speech and expression opens up channels of free discussion of issues. Freedom of speech plays a crucial role in the formation of public opinion on social, political and economical matters. It has received a broad construction by the Supreme Court.[2]

The right given in Art.19 (1) (a) is not merely a right of speech and expression but a right to freedom of speech and expression. The enumeration by other rights is not by reference to ‘ freedom ‘. The right under Article 19 are available to citizens only.

Art. 19 (1)(a) includes the rights to express one’s views and opinions at any issue through any medium , e.g., by words of mouth, writing, printing, picture, film, movie etc. It thus includes the freedom of communication and the right to propagate or publish opinion. Not only this, but the right to paint or sing or dance or to write poetry or literature is also covered by Article 19(1)(a) because these are all a form of expression. But this right is subject to reasonable restrictions being imposed under Article 19(2). Art. 19(1)(a) corresponds to the Amendment I of the U.S. Constitution which says: “Congress shall make no law….abridging the freedom of speech or of the press.”

In the U.S. Constitution the effect of use of the above expression was that the freedom of speech of press was considered absolute and free from any restrictions whatsoever. In this respect it is different from Art. 19 (1)( a) which puts reasonable restrictions in the form of Art. 19 (2). However, to say that there is unrestricted freedom of press in U.S. will not be correct because the US Supreme Court has evolved the doctrine of ` balancing of interests ’. Also, another difference between the U.S. Constitution and the Indian Constitution is that in the U.S. Constitution the freedom of press is expressly mentioned whereas under the Indian Constitution it is not so.[3]

Freedom of Press:

The press is the medium of social, public and political intercourse and is the means of expression of opinion, a means of communication of facts of public life. It is an educator of the people, the electorate and all persons generally. It is the fourth estate of the State. There is no separate mention of the freedom of the press, but it is held to be included in the larger freedom of speech and expression. The freedom of the press is separately mentioned in the American Constitution. Under our constitution it has been held to be implicitly guaranteed as a part of the freedom of speech and expression in terms of Article 19 (1) (a).[4]

The democratic credentials of a State are judged today by the extent of the freedom the press enjoys in that State. Freedom of thought and expression, and the freedom of the press are not only valuable freedoms in themselves but are basic to a democratic form of government.[5]

Imposition of pre-censorship on a newspaper, or prohibiting it from publishing its own views or those of its correspondents on a burning topic of the day, constitutes an encroachment on the freedom of speech and expression.

In Brij Bhushan v. State of Delhi[6]in pursuance of Sec. 7(1)(c) of the East Punjab Public Safety Act, 1949 as extended to the province of Delhi, the Chief Commissioner of Delhi issued an order against the petitioner, the printer, publisher and editor of a English weekly ‘The Organiser’ published from Delhi, directing them to submit, for scrutiny in duplicate, before publication till further order, all communal matters and news and views about Pakistan including photographs and cartoons other that those derived from official sources. The majority of the Supreme Court struck down the order as violative of Art. 19(1)(a).[7]

Also, freedom to circulate is included in freedom of press, as a publication is of little value without circulation. In Romesh Thaper v. State of Madras[8]the Provincial Government in exercise of its powers under Sec. 9 (1-A) of the Madras Maintenance of Public Order Act, 1949, by an order, imposed a ban upon the entry and circulation of the petitioner’s weekly journal “Cross Roads” printed and published in Bombay. Majority of the Supreme Court held the order as invalid as violation Art. 19(1)(a).

In Sakal Papers (P) Ltd. v. Union of India,[9]the Supreme Court held that the right to propagate ideas guaranteed in Art. 19(1)(a) extended not merely to the matter which a person was entitled to circulate but also to the volume of circulation . In this case, in the pursuance of the provision of the Newspapers (Price and Page) Act, 1956, the Central Government issued the Daily Newspapers (Price and Page) Order, 1960 which fixed the maximum number of pages that might be published by the newspaper according to the price charged. The order fixed a minimum price and number of pages which a newspaper was entitled to publish. The petitioners were required to increase the price of their newspaper if they were increasing the pages. On the other hand, if the petitioners were to reduce the price, they were required to decrease the number of pages.

The order was challenged as violative of the freedom of press, since its adoption meant either the reduction in the existing number of pages or raising the price. This amounted to directed infringement of the liberty of the press . The Supreme Court struck down the order.

Another case was that of Bennett Coleman v. Union of India.[10]India imported newsprint from foreign countries. Because of the shortage of foreign exchange, quantity of newsprint was not adequate to meet all requirements. Some restrictions, therefore, became necessary on the consumption of newsprint. Accordingly, a system of newsprint quota for newspapers was evolved. A few more restrictions concerning number of pages and entitlement, etc., were also imposed. The dominant direction of the policy was to curtail the growth of big newspapers which could not increase the number of pages, page area or periodicity. The newsprint policy was challenged in the Supreme Court.

By a majority, the Supreme Court declared the policy unconstitutional. While the government could evolve a policy of allotting newsprint on a fair and equitable basis, the government could not, in the garb of regulating the distribution of newsprint, control the growth and circulation of newspapers.

In Indian Express Newspapers (Bombay) Pvt. Ltd. v. Union of India[11]several newspapers filed writ petitions challenging the constitutional validity of the notifications issued by the Centre imposing from March 1, 1981, specified rates of customs duty and auxiliary duty on newsprint imported by different categories of newspapers. The levy was challenged in the Supreme Court. The main plea of the petitioners was that the impugned levy of duty on imported newsprint was excessive and had the direct effect of crippling the freedom of speech and expression and the carrying on of the business of publishing newspapers as it had led to an increase in the price of newspapers resulting in reduction of their circulation. The Supreme Court accepted the plea of the newspapers and said that the government must be more cautious while levying taxes on matters concerning newspaper industry than while levying taxes on other matters.

In Smt. Prabha Dutt v. Union of India the question was whether prisoners condemned to death could be interviewed. It was held that the newspaper reporters can interview the prisoners condemned to death if they are willing to be interviewed. Unless, in a given case there are weighty reasons for denying the opportunity to interview. The reasons for denying the interview should be recorded in writing.[12]

In M. Hasan v. State of Andhra Pradesh,[13]the Andhra Pradesh High Court has held that denial of permission to a press reporter to interview a willing condemned prisoner on a ground not falling within Art. 19(2) is not valid. “Any such denial is deprivation of a citizen’s fundamental right of freedom of speech and expression”. Convicts are not wholly denuded of their fundamental rights.

Further, the Press Council Act, 1978 provides that a journalist should not be compelled to disclose the source of any news or information published by the newspaper. But the Division Bench in In Re: Harijai Singh[14]has held that if justice demands, scribe may be compelled to reveal the source of their news. In this contempt case against the editors of the Tribune and the Punjab Kesari, the contemnors, while tendering apology, revealed the source of their news item.

Commercial Advertisements

In Hamdard Dawakhana v. Union of India[15]the Supreme Court considered the question that how far are advertisements protected under Art. 19(1)(a). In this case, Parliament enacted an Act with a view to control advertisements of drugs in certain cases. The Act was challenged on the ground that restrictions on advertisements was a direct abridgment of the freedom of expression. The Court stated that an advertisement, no doubt, is a form of speech, but its true character is to be determined by the object which it seeks to promote.

An advertisement promoting drugs and commodities, the sale of which is not in public interest, could not be regarded as propagating any idea and, as such, could not claim the protection of Art. 19(1)(a). An advertisement meant to further business falls within the concept of trade and commerce and cannot be regarded as a part of freedom of speech.[16]

However, in Indian Express Newspapers (Bombay) Pvt. Ltd. v. Union of India[17]differing from the Hamdard Dawakhanaruling, the Supreme Court observed that all commercial advertisements cannot be denied the protection of Art. 19(1) (a) of the Constitution merely because they are issued by businessmen. Advertising pays large portion of the costs of supplying the public with newspapers.

Reading Hamdard Dawakhana and Indian Express together, the Supreme Court has concluded in Tata Press Ltd. v. Mahanagar Telephone Nigam Ltd.,[18] that ‘commercial speech’ cannot be denied the protection of Art. 19 (1)(a) merely because the same is issued by businessmen. It is a part of freedom of speech and the public at large has a right to receive the ‘commercial speech’.

Television and Censorship of Films

Television plays a very important and significant role in modern life. Many people obtain the bulk of their information on matters of contemporary interest from the broadcasting medium.

In Anand Patwardhan v. Union of India,[19] the petitioner produced a documentary on violence and terrorism in Punjab. The film received a ‘U’ certificate from the board of film censors. Nevertheless the Doordarshan refused to telecast the film. The Bombay High Court ruled that the refusal to telecast amounted to violation of the petitioner’s right under article 19(1)(a). It also amounted to violation of the right of the people under Art. 19(1)(a) to be informed about the situation in Punjab. Accordingly, the court directed Doordarshan to exhibit the film.

In Indira Jai Singh v. Union of India, during the course of recording of the interview of the petitioner for a T.V. programme pertaining to ‘Law relating to Women’ on an interview of Doordarshan itself, she made critical remarks about a Bill which was then pending before Parliament as being violative of women’s right to equality. When the programme was telecast, her views on the Bill were deleted. The petitioner in a writ petition asserted that this amounted to censorship of her views by the television authorities as her views were against the views of the ruling party. The Doordarshan authorities justified the deletion on the basis that it only amounted to editing and not censorship. The High Court ruled in favor of the petitioner.[20]

In K.A. Abbas v. Union of India[21] the constitutionality of films as a media of expression and its censorship came up before the Supreme Court. The petitioner, unable to get ‘U’ certificate for his film ‘Tale of four cities” questioned the validity of the Cinematograph Act 1952 along with the rules made there under. The Supreme Court upheld censorship of films under Art. 19(1)(a) on the ground that films have to be treated separately from other forms of art and expression because a motion picture is able to stir up emotions more deeply than any other product of art. A film can therefore be censored on the grounds mentioned in Art. 19(2).

In Ajay Goswami v. Union of India,[22] a writ petition was filed to ensure that minors are not exposed to sexually oriented material being published in certain newspapers without the consent of parents or guardians. It was held that the incidence of shielding minors should not be such that the adult population is made to see and read what is fit for children. The court held that there should be no suppression of speech and expression supposedly to protect children from harmful material. The court stated that there were already sufficient safeguards available in terms of various legislations, norms, rules and regulations to protect society in general under Press Council Act and IPC.

Trial by Media

Interference with administration of justice is neither a permissible freedom nor an unreasonable restriction. In the case of M. P. Lohia v. State of West Bengal, AIR 2005 SC 790, relating to suicide by wife due to her harassment for dowry, an applica­tion for grant of anticipatory bail was rejected by Courts below. When special leave petition from such rejection was pending before Supreme Court, an article appeared in a magazine based on an interview of the family of the deceased, giving their version of the tragedy and extensively quoting the father of the deceased as to his version of the case which could all be materials that may be used in the forthcoming trial. The Supreme Court took the view that such articles appearing in the media would certainly interfere with the administration of jus­tice and deprecated such practice and cautioned the publisher, editor and the journalist who were responsible for the said article against indulging in such trial by media when the issue was sub judice.

In Rajendra Sail v. M. P. High Court Bar Association, AIR 2005 SC 2473 it was held that while the media can, in the public interest, resort to reasonable criticism of a judicial act or the judgment of a Court for public good or report any such state­ments, it should refrain from casting scurrilous aspersions on, or impute improper motives or personal bias to the judge. Nor should they scandalize the Court or the judiciary as a whole, or make personal allegations of lack of ability or integrity against a judge. The judgments of Courts are public documents and can be commented upon, analyzed and criticized, but it has to be in a dignified manner without attributing motives.

Conclusion:

While it is necessary to maintain and preserve freedom of speech and expression in a democracy, it is also necessary to place some curbs on this freedom for the maintenance of social order. Accordingly under Art. 19(2) the state may make a law imposing reasonable restrictions on the exercise of the right to freedom of speech and expression. The expression used in Art. 19(2) “in the interest of” gives a wide amplitude to the permissible law which can be enacted to impose reasonable restrictions on the right guaranteed by Art 19(1)(a).

There have been many cases that have come before the court relating to freedom of media under Art. 19 (1)(a) and the effect of reasonable restrictions on this freedom. The key is to balance the right with the duties. No doubt media has the freedom of speech and expression but it should also utilize this right in a judicious manner.

[2] Jain, M.P., Indian Constitutional Law, 6 th Ed., LexisNexis Butterworths Wadhwa Nagpur Ltd., Gurgaon, 2010, p. 1078

[4] Kagzi, The Constitution of India: Very Exhaustive Commentary, Vol. 2, 6 th Ed., India law House, New Delhi, 2004, p. 1147

[5] Kashyap, Dr. Subhash C., Constitutional Law of India, Vol. 1, Universal Law Publishing Co. Pvt. Ltd., New Delhi, 2008, p. 570

[7] Kumar, Dr. Narendra, Constitutional Law of India, 7 th Ed., Allahabad Law Agency, Faridabad, 2008, p. 230


Specifies alignment of content.

The content alignment has not been specified.

Content is vertically aligned at the top, and horizontally aligned on the left.

Content is vertically aligned at the top, and horizontally aligned at the center.

Content is vertically aligned at the top, and horizontally aligned on the right.

Content is vertically aligned in the middle, and horizontally aligned on the left.

Content is vertically aligned in the middle, and horizontally aligned at the center.

Content is vertically aligned in the middle, and horizontally aligned on the right.

Content is vertically aligned at the bottom, and horizontally aligned on the left.

Content is vertically aligned at the bottom, and horizontally aligned at the center.

Content is vertically aligned at the bottom, and horizontally aligned on the right.


Watch the video: Katrin Davidsdottir - Open (December 2021).