C2021-026 Parent/Child applicability in RO Editor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*********************************************************************************************
|
||||
* Copyright 2002 - Volian Enterprises, Inc. All rights reserved.
|
||||
* Copyright 2021 - Volian Enterprises, Inc. All rights reserved.
|
||||
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
* ------------------------------------------------------------------------------
|
||||
* $Workfile: ROField.cs $ $Revision: 11 $
|
||||
@@ -63,12 +63,22 @@ using System.Text;
|
||||
|
||||
namespace ROFields
|
||||
{
|
||||
// Field Types:
|
||||
// SingleTxt - Single Line Text
|
||||
// VariableTxt - Variable Length Text (multiple lines)
|
||||
// FrmtSingleTxt - Single Line Formatted text - used for Accessory ID fields
|
||||
// XYPlot - used to enter the plot language commands
|
||||
// Table - Used to enter a table (16-bit VE-PROMS text based style using dashes and pipe characters to define cells)
|
||||
// Image - Used for images (ex. TIF,JPG,BMP file references)
|
||||
// MultiTxt - ??
|
||||
// Combination - used for Setpoint return values - user can select type of return value (Single/Multi line text, Table, X/Y Plot)
|
||||
// when entering the RO data
|
||||
// MultiField - ??
|
||||
public enum FieldTypes: uint
|
||||
{
|
||||
Nil=0, SingleTxt=1, VariableTxt=2, FrmtSingleTxt=4, XYPlot=8, Table=10, Image=32,
|
||||
MultiTxt=40, Combination=128, MultiFld=100
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Summary description for ROField: This class contains RO Field information. Each ROField
|
||||
/// contains:
|
||||
@@ -92,7 +102,7 @@ namespace ROFields
|
||||
recID = rID;
|
||||
masterrecID = mrID;
|
||||
fldtype = fieldtype;
|
||||
}
|
||||
}
|
||||
public string GetFieldname { get {return fieldname;}}
|
||||
public string GetRecID { get {return recID;}}
|
||||
public string GetMasterRecID { get {return masterrecID;}}
|
||||
@@ -101,7 +111,23 @@ namespace ROFields
|
||||
public void SetRecID(string recid) {recID = recid;}
|
||||
public void SetMasterRecID(string mrecid) {masterrecID = mrecid;}
|
||||
public void SetFieldType(uint ftype) {fldtype = ftype;}
|
||||
|
||||
|
||||
// C2021-026 return true if we allow child values for the current field type
|
||||
public bool FieldTypeCanDoApplicability()
|
||||
{
|
||||
bool rtnval = false;
|
||||
switch (fldtype)
|
||||
{
|
||||
case (uint)FieldTypes.SingleTxt:
|
||||
case (uint)FieldTypes.VariableTxt:
|
||||
case (uint)FieldTypes.Combination:
|
||||
rtnval = true;
|
||||
break;
|
||||
}
|
||||
return rtnval;
|
||||
}
|
||||
|
||||
|
||||
// Given a schema string, determine which RO Field type it is.
|
||||
public uint ParseFieldType(string info)
|
||||
{
|
||||
@@ -191,7 +217,7 @@ namespace ROFields
|
||||
StringBuilder strbld = new StringBuilder();
|
||||
strbld.Append("<xsd:element name=\"");
|
||||
strbld.Append(MakeFieldName(fieldname));
|
||||
strbld.Append("\" minOccurs=\"0\">\n");
|
||||
strbld.Append("\" minOccurs=\"0\">\n");
|
||||
if (ftype == (uint)FieldTypes.VariableTxt || ftype == (uint)FieldTypes.Table || ftype == (uint)FieldTypes.XYPlot)
|
||||
{
|
||||
strbld.Append("<xsd:annotation>\n<xsd:documentation xml:lang=\"en\">");
|
||||
|
Reference in New Issue
Block a user