Skip to content

Commit

Permalink
Updating example to allow for writing to MakingCarCalls property of Lift
Browse files Browse the repository at this point in the history
  • Loading branch information
ssmethurst committed Jul 4, 2019
1 parent b2eccea commit 865b8f2
Show file tree
Hide file tree
Showing 5 changed files with 389 additions and 90 deletions.
Expand Up @@ -8,6 +8,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputPath>..\..\bin\</OutputPath>
<WarningLevel>2</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Expand Up @@ -44,6 +44,21 @@ class ExampleDatabase
// shall be unique for the groups in this machine room, but might not be otherwise
// unique in the building.

// Lift properties
// -------------------------
// All Lifts have the same floor names.
public static string[] FLOOR_NAMES = { "Basement", "Lobby", "One", "Two", "Three", "Four", "Five", "Roof" };
public static string[] LIFT_CAR_DOOR_TEXT = { "Front" };
// BACnetDoorStatus::= ENUMERATED {closed(0), opened(1), unknown(2), door-fault(3), unused(4), none(5), closing(6), opening(7), safety-locked(8), limited-opened(9), ...}
public const UInt32 LIFT_CAR_DOOR_STATUS = 0;
public const bool LIFT_PASSENGER_ALARM = false;
public HashSet<UInt32> LIFT_FAULT_SINGALS;


// BACnetLiftCarDirection ::= ENUMERATED { unknown (0), none (1), stopped (2), up (3), down (4), up-and-down (5), ... }
public const UInt32 LIFT_CAR_MOVING_DIRECTION = 1; // None
public const Byte LIFT_CAR_POSITION = 3;
public const float LIFT_ENERGY_METER_VALUE = 0.0f;

// Two escalators
// ----------------------------------------------------------------------------------
Expand Down Expand Up @@ -78,31 +93,39 @@ class ExampleDatabase
public static UInt32 SETTING_LIFT_C_INSTANCE = 2001;
public static string SETTING_LIFT_C_NAME = "People Lifter (C)";
public static Byte SETTING_LIFT_C_INSTALLATION_ID = 1;
public static Byte[] SETTING_LIFT_C_MAKING_CAR_CALL = new Byte[] { 0 };

// LIFT D
public static UInt32 SETTING_LIFT_D_INSTANCE = 2002;
public static string SETTING_LIFT_D_NAME = "People Lifter (D)";
public static Byte SETTING_LIFT_D_INSTALLATION_ID = 2;
public static Byte[] SETTING_LIFT_D_MAKING_CAR_CALL = new Byte[] { 0 };

// A double decker lift.
// ----------------------------------------------------------------------------------
// LIFT E
public static UInt32 SETTING_LIFT_E_INSTANCE = 2003;
public static string SETTING_LIFT_E_NAME = "Top of a double decker People Lifter (E)";
public static Byte SETTING_LIFT_E_INSTALLATION_ID = 3;
public static Byte[] SETTING_LIFT_E_MAKING_CAR_CALL = new Byte[] { 0 };

// LIFT F
public static UInt32 SETTING_LIFT_F_INSTANCE = 2004;
public static string SETTING_LIFT_F_NAME = "Bottom of a double decker People Lifter (F)";
public static Byte SETTING_LIFT_F_INSTALLATION_ID = 4;
public static Byte[] SETTING_LIFT_F_MAKING_CAR_CALL = new Byte[] { 0 };

// Lift and escalators without groups.
// ----------------------------------------------------------------------------------
// Lift G
// This lift has two doors.
public static UInt32 SETTING_LIFT_G_INSTANCE = 2005;
public static string SETTING_LIFT_G_NAME = "People Lifter (G)";
public static Byte SETTING_LIFT_G_INSTALLATION_ID = 1;
public static Byte SETTING_LIFT_G_GROUP_ID = 3;
public static Byte SETTING_LIFT_G_DOOR_COUNT = 2;
public static string[] SETTING_LIFT_G_DOOR_TEXT = { "Front", "Rear" };
public static Byte[] SETTING_LIFT_G_MAKING_CAR_CALL = new Byte[] { 0, 0 };

// ESCALATOR H
public static UInt32 SETTING_ESCALATOR_H_INSTANCE = 1003;
Expand All @@ -124,21 +147,7 @@ class ExampleDatabase
public HashSet<UInt32> ESCALATOR_FAULT_SINGALS;
public const float ESCALATOR_ENERGY_METER_VALUE = 0.0f;

// Lift properties
// -------------------------
// All Lifts have the same floor names.
public static string[] FLOOR_NAMES = { "Basement", "Lobby", "One", "Two", "Three", "Four", "Five", "Roof" };
public static string[] LIFT_CAR_DOOR_TEXT = { "Front" };
public static int LIFT_CAR_DOOR_COUNT = LIFT_CAR_DOOR_TEXT.Length;
// BACnetDoorStatus::= ENUMERATED {closed(0), opened(1), unknown(2), door-fault(3), unused(4), none(5), closing(6), opening(7), safety-locked(8), limited-opened(9), ...}
public const UInt32 LIFT_CAR_DOOR_STATUS = 0;
public const bool LIFT_PASSENGER_ALARM = false;
public HashSet<UInt32> LIFT_FAULT_SINGALS;

// BACnetLiftCarDirection ::= ENUMERATED { unknown (0), none (1), stopped (2), up (3), down (4), up-and-down (5), ... }
public const UInt32 LIFT_CAR_MOVING_DIRECTION = 1; // None
public const Byte LIFT_CAR_POSITION = 3;
public const float LIFT_ENERGY_METER_VALUE = 0.0f;


public void Setup()
{
Expand All @@ -162,6 +171,11 @@ public void Setup()

}

public void Loop()
{

}

}

}
Expand Up @@ -11,16 +11,16 @@ unsafe class CASBACnetStackAdapter
{
#if WINDOWS
#if (DEBUG)
const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Debug.dll";
public const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Debug.dll";
#else
const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Release.dll";
public const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Release.dll";
#endif // DEBUG
#else
// Linux
#if (DEBUG)
const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Debug.so";
public const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Debug.so";
#else
const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Release.so";
public const string BACNET_API_DLL_FILENAME = "CASBACnetStack_x64_Release.so";
#endif // DEBUG
#endif // _WINDOWS

Expand Down Expand Up @@ -846,6 +846,12 @@ unsafe class CASBACnetStackAdapter
public const UInt32 ENGINEERING_UNITS_MINUTESPERDEGREEKELVIN = 236;
#endregion

#region Errors
public const UInt32 ERROR_INVALID_ARRAY_INDEX = 42;
public const UInt32 ERROR_VALUE_OUT_OF_RANGE = 37;
public const UInt32 ERROR_NO_SPACE_TO_WRITE_PROPERTY = 20;
#endregion

#region Get Callback functions delegate
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate UInt16 delegateSendMessage(System.Byte* message, UInt16 messageLength, System.Byte* connectionString, System.Byte connectionStringLength, System.Byte networkType, [In, MarshalAs(UnmanagedType.I1)] bool broadcast);
Expand Down

0 comments on commit 865b8f2

Please sign in to comment.