Home AMX User Forum Duet/Cafe Duet

button and level

I use the following code to simulate a button or press an action, and I will receive two push releases

public static void fnSendButtonFeedback(boolean state,int number, int port,Module onBehalfOf)

{// TODO Change the TSE for your own needs

AdvancedEvent advEv = new AdvancedEvent(new Boolean(false),CrestronappAdvancedEvent.MISC);

Event ev = new Event();

if(state) {

ev.type = Event.E_PUSH;

}

else {

ev.type = Event.E_RELEASE;

}

ev.idx = number;

ModuleComponentEvent e = new ModuleComponentEvent(onBehalfOf, advEv, ev, port);

onBehalfOf.processAdvancedEvent(e);

}

Line 1 2024-08-30 (18:01:20):: Input Status:Pushed [41001:1:1] - Channel 10
Line 2 2024-08-30 (18:01:20):: Input Status:Pushed [41001:1:1] - Channel 10
Line 3 2024-08-30 (18:01:20):: Command To [5001:1:1]-[push]
Line 4 2024-08-30 (18:01:20):: Input Status:Released [41001:1:1] - Channel 10
Line 5 2024-08-30 (18:01:20):: Input Status:Released [41001:1:1] - Channel 10
Line 6 2024-08-30 (18:01:20):: Command To [5001:1:1]-[release]

public static void fnSendLevelFeedback(int number,int value, int port,Module onBehalfOf)

{// TODO Change the TSE for your own needs

AdvancedEvent advEv = new AdvancedEvent(new Boolean(false),CrestronappAdvancedEvent.MISC);

//Level level = new Level(Level.L_SINTEGER,value);

Event ev = new Event();

ev.type = Event.E_LEVEL;

ev.idx = number;

//ev.dataType = Event.D_LEVEL;

ev.dataType = 1;

ev.dataValue = new Level(value);

onBehalfOf.log(4,"Value"+value);

ModuleComponentEvent e = new ModuleComponentEvent(onBehalfOf, advEv, ev, port);

onBehalfOf.processAdvancedEvent(e);

}

Why do pull strips have decimal places?
Line 1 2024-08-30 (18:02:08):: Level Value From [41001:1:1] - Level 1 Value= 7.000000
Line 2 2024-08-30 (18:02:08):: Level Value From [41001:1:1] - Level 1 Value= -1.000000
Line 3 2024-08-30 (18:02:08):: String To [5001:1:1]-[LevelNumber:1:Value:-1]
Line 4 2024-08-30 (18:02:08):: Level Value From [41001:1:1] - Level 1 Value= -10.000000
Line 5 2024-08-30 (18:02:08):: String To [5001:1:1]-[LevelNumber:1:Value:-10]
Line 6 2024-08-30 (18:02:08):: Level Value From [41001:1:1] - Level 1 Value= -13.000000
Line 7 2024-08-30 (18:02:08):: String To [5001:1:1]-[LevelNumber:1:Value:-13]
Line 8 2024-08-30 (18:02:10):: Level Value From [41001:1:1] - Level 1 Value= -5.000000
Line 9 2024-08-30 (18:02:10):: String To [5001:1:1]-[LevelNumber:1:Value:-5]
Line 10 2024-08-30 (18:02:10):: Level Value From [41001:1:1] - Level 1 Value= -2.000000
Line 11 2024-08-30 (18:02:10):: String To [5001:1:1]-[LevelNumber:1:Value:-2]

Sign In or Register to comment.