public void Setup()
        {
            this.Device = new ExampleDatabaseDevice()
            {
                Name             = "Example Trending Device",
                Instance         = 389000,
                Description      = "Example device to demonstrate Import and Export Trend Log functionality of the CAS BACnet Stack",
                ModelName        = "BACnetServerTrendLogExampleCSharp",
                VendorIdentifier = 389,
                VendorName       = "Chipkin Automation Systems"
            };

            this.AnalogInputAutoIncrement = new ExampleDatabaseAnalogInput()
            {
                Name         = "AI - Auto Increment",
                Instance     = 1,
                PresentValue = 0.0f
            };

            this.AnalogInputManualIncrement = new ExampleDatabaseAnalogInput()
            {
                Name         = "AI - Manual Increment",
                Instance     = 2,
                PresentValue = 0.0f
            };

            this.BinaryInput = new ExampleDatabaseBinaryInput()
            {
                Name         = "BI - Binary Input",
                Instance     = 3,
                PresentValue = false
            };

            this.MultiStateInput = new ExampleDatabaseMultiStateInput()
            {
                Name         = "MSI - Multi-State Input",
                Instance     = 4,
                PresentValue = 1,
                StateText    = ExampleDatabaseMultiStateInput._colorText
            };

            this.TrendLog = new ExampleDatabaseTrendLog()
            {
                Name     = "TL - Trend Log (AI1)",
                Instance = 10,
            };

            this.TrendLogMultiple = new ExampleDatabaseTrendLogMultiple()
            {
                Name     = "TLM - Trend Log Multiple (AI1, AI2, BI3, MSI4)",
                Instance = 20,
            };
        }
        public void Setup()
        {
            this.Device = new ExampleDatabaseDevice();

            // Default Values
            this.Device.name                   = "Device name Rainbow";
            this.Device.instance               = 389001;
            this.Device.description            = "This is the example description";
            this.Device.vendorIdentifiier      = 389; // 389 is Chipkin's vendorIdentifiier
            this.Device.vendorName             = "Chipkin Automation Systems";
            this.Device.modelName              = "Windows-BACnetServerExampleCSharp";
            this.Device.proprietaryProperty513 = "Proprietary property 513 readonly";
            this.Device.proprietaryProperty514 = "Proprietary property 514 read/write";
        }
Example #3
0
        public void Setup()
        {
            this.Device                = new ExampleDatabaseDevice();
            this.AnalogInput           = new ExampleDatabaseAnalog[COUNT_ANALOG_INPUT];
            this.AnalogOutput          = new ExampleDatabaseAnalogOutput[COUNT_ANALOG_OUTPUT];
            this.AnalogValue           = new ExampleDatabaseAnalogValue[COUNT_ANALOG_VALUE];
            this.BinaryInput           = new ExampleDatabaseBinary[COUNT_BINARY_INPUT];
            this.BinaryValue           = new ExampleDatabaseBinary[COUNT_BINARY_VALUE];
            this.MultiStateInput       = new ExampleDatabaseMultiState[COUNT_MULTI_STATE_INPUT];
            this.MultiStateValue       = new ExampleDatabaseMultiState[COUNT_MULTI_STATE_VALUE];
            this.CharacterString       = new ExampleDatabaseCharacterString[COUNT_CHARACTER_STRING_VALUE];
            this.PositiveIntergerValue = new ExampleDatabasePositiveIntergerValue[COUNT_POSITIVE_INTEGER_VALUE];
            this.DateValue             = new ExampleDatabaseDateValue[COUNT_DATE_VALUE];
            this.TimeValue             = new ExampleDatabaseTimeValue[COUNT_TIME_VALUE];


            // Default Values
            this.Device.name              = "Device name Rainbow";
            this.Device.instance          = 389001;
            this.Device.description       = "This is the example description";
            this.Device.vendorIdentifiier = 389; // 389 is Chipkin's vendorIdentifiier
            this.Device.protocolRevision  = 16;  // Overide the protocolRevision
            this.Device.vendorName        = "Chipkin Automation Systems";
            this.Device.modelName         = "BACnetServerExampleCSharp";

            // Setup objects with default values
            for (UInt32 offset = 0; offset < this.AnalogInput.Length; offset++)
            {
                this.AnalogInput[offset] = new ExampleDatabaseAnalog();
                this.AnalogInput[offset].presentValue = (float)offset * 100f + offset * 0.1f;
                this.AnalogInput[offset].name         = "AnalogInput " + this.GetColorName();
                this.AnalogInput[offset].description  = "Example description";
                this.AnalogInput[offset].units        = CASBACnetStackAdapter.ENGINEERING_UNITS_NO_UNITS;
                this.AnalogInput[offset].outOfService = false;
            }
            for (UInt32 offset = 0; offset < this.AnalogOutput.Length; offset++)
            {
                this.AnalogOutput[offset]                   = new ExampleDatabaseAnalogOutput();
                this.AnalogOutput[offset].name              = "AnalogOutput " + this.GetColorName();
                this.AnalogOutput[offset].units             = CASBACnetStackAdapter.ENGINEERING_UNITS_NO_UNITS;
                this.AnalogOutput[offset].outOfService      = false;
                this.AnalogOutput[offset].relinquishDefault = (float)offset * 1.1f;
                for (int index = 0; index < this.AnalogOutput[offset].priorityArrayNulls.Length; index++)
                {
                    this.AnalogOutput[offset].priorityArrayNulls[index] = true;
                }
            }
            for (UInt32 offset = 0; offset < this.AnalogValue.Length; offset++)
            {
                this.AnalogValue[offset] = new ExampleDatabaseAnalogValue();
                this.AnalogValue[offset].presentValue = offset * 100f + offset * 0.1f;
                this.AnalogValue[offset].name         = "AnalogValue " + this.GetColorName();
                this.AnalogValue[offset].units        = CASBACnetStackAdapter.ENGINEERING_UNITS_NO_UNITS;
                this.AnalogValue[offset].outOfService = false;
            }
            for (UInt32 offset = 0; offset < this.BinaryInput.Length; offset++)
            {
                this.BinaryInput[offset] = new ExampleDatabaseBinary();
                this.BinaryInput[offset].presentValue = false;
                this.BinaryInput[offset].name         = "BinaryInput " + this.GetColorName();
            }
            for (UInt32 offset = 0; offset < this.BinaryValue.Length; offset++)
            {
                this.BinaryValue[offset] = new ExampleDatabaseBinary();
                this.BinaryValue[offset].presentValue = false;
                this.BinaryValue[offset].name         = "BinaryValue " + this.GetColorName();
            }
            for (UInt32 offset = 0; offset < this.MultiStateInput.Length; offset++)
            {
                this.MultiStateInput[offset]              = new ExampleDatabaseMultiState();
                this.MultiStateInput[offset].name         = "MultiStateInput " + this.GetColorName();
                this.MultiStateInput[offset].stateText    = ExampleDatabaseMultiState._windCompassText;
                this.MultiStateInput[offset].presentValue = Convert.ToUInt32(offset % this.MultiStateInput[offset].stateText.Length);
            }
            for (UInt32 offset = 0; offset < this.MultiStateValue.Length; offset++)
            {
                this.MultiStateValue[offset]              = new ExampleDatabaseMultiState();
                this.MultiStateValue[offset].name         = "MultiStateValue " + this.GetColorName();
                this.MultiStateValue[offset].stateText    = ExampleDatabaseMultiState._windCompassText;
                this.MultiStateValue[offset].presentValue = Convert.ToUInt32(offset % this.MultiStateValue[offset].stateText.Length);
            }
            for (UInt32 offset = 0; offset < this.CharacterString.Length; offset++)
            {
                this.CharacterString[offset]              = new ExampleDatabaseCharacterString();
                this.CharacterString[offset].name         = "CharacterString " + this.GetColorName();
                this.CharacterString[offset].presentValue = "Value of the CharacterString object";
            }
            for (UInt32 offset = 0; offset < this.PositiveIntergerValue.Length; offset++)
            {
                this.PositiveIntergerValue[offset]              = new ExampleDatabasePositiveIntergerValue();
                this.PositiveIntergerValue[offset].name         = "PositiveIntergerValue " + this.GetColorName();
                this.PositiveIntergerValue[offset].presentValue = offset * 1000;
            }
            for (UInt32 offset = 0; offset < this.DateValue.Length; offset++)
            {
                this.DateValue[offset]      = new ExampleDatabaseDateValue();
                this.DateValue[offset].name = "DateValue " + this.GetColorName();
                this.DateValue[offset].Set(2019 - 1900, 6, 7, 5);
            }

            for (UInt32 offset = 0; offset < this.TimeValue.Length; offset++)
            {
                this.TimeValue[offset]      = new ExampleDatabaseTimeValue();
                this.TimeValue[offset].name = "TimeValue " + this.GetColorName();
                this.TimeValue[offset].Set(15, 13, 55, 0);
            }

            // NetworkPort
            this.NetworkPort                 = new ExampleDatabaseNetworkPort();
            this.NetworkPort.name            = "NetworkPort " + this.GetColorName();
            this.NetworkPort.BACnetIPUDPPort = 47808;
        }