Skip to content

Commit

Permalink
Added hardware triggered dpc and fpm commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack committed Nov 10, 2018
1 parent f0d02b5 commit 1f0d881
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 27 deletions.
14 changes: 11 additions & 3 deletions illuminate/commandconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define COMMAND_CONSTANTS_H

// List of command indicies in below array
#define COMMAND_COUNT 52
#define COMMAND_COUNT 54

#define CMD_HELP_IDX 0
#define CMD_ABOUT_IDX 1
Expand Down Expand Up @@ -93,12 +93,15 @@
#define CMD_SET_PN 50
#define CMD_SET_SN 51

#define CMD_RUN_SEQ_DPC_IDX 52
#define CMD_RUN_SEQ_FPM_IDX 53

// Syntax is: {short command, long command, description, syntax}
const char* command_list[COMMAND_COUNT][4] = {

// High-level Commands
{"?", "help", "Display help info", "?"},
{"ab", "about", "Displays information about this LED Array", "about"},
{"info", "about", "Displays information about this LED Array", "about"},
{"reboot", "reset", "Runs setup routine again, for resetting LED array", "reboot"},
{"ver", "version", "Display controller version number"},

Expand Down Expand Up @@ -166,7 +169,12 @@ const char* command_list[COMMAND_COUNT][4] = {

// Set part and serial number in EEPROM
{"setsn", "setSerialNumber", "Sets device serial number in EEPROM (DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING"},
{"setpn", "setPartNumber", "Sets device part number in EEPROM (DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING"}
{"setpn", "setPartNumber", "Sets device part number in EEPROM (DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING"},

// Run case-specific sequences
{"rdpc", "runDpc", "Runs a DPC sequence with specified delay between each update. If update speed is too fast, a warming message will print.", "rdpc,[Delay between each pattern in ms].[Number of acquisitions].[trigger mode for index 0].[trigger mode for index 1].[trigger mode for index 2] "},
{"rfpm", "runFpm", "Runs a FPM sequence with specified delay between each update. If update speed is too fast, a warming message will print.", "rfpm,[Delay between each pattern in ms].[Number of acquisitions].[Maximum NA * 100 (e.g. 0.25NA would be 25].[trigger mode for index 0].[trigger mode for index 1].[trigger mode for index 2] "},

};

#endif
16 changes: 10 additions & 6 deletions illuminate/commandrouting.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ int CommandRouter::getArgumentBitDepth(char * command_header)
return (-1);
}

/* This function is used to dictate the pitch of led numbers in a command stream.
Every value at this pitch will be stored as a uint16_t instead of the default datatype */
/* This function is used to dictate the pitch of led numbers in a command stream.
Every value at this pitch will be stored as a uint16_t instead of the default datatype */
int CommandRouter::getArgumentLedNumberPitch(char * command_header)
{
if ((strcmp(command_header, command_list[CMD_SET_SEQ_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_SEQ_IDX][1]) == 0))
// return (led_array->getColorChannelCount() + 1);
return(2);
// return (led_array->getColorChannelCount() + 1);
return (2);
else
return (-1);
}
Expand All @@ -168,7 +168,7 @@ void CommandRouter::route(char * command_header, int16_t argc, void ** argv, int
led_array->setNa(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_SET_COLOR_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_COLOR_IDX][1]) == 0))
led_array->setColor(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_SET_BRIGHTNESS][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_BRIGHTNESS][1]) == 0))
else if ((strcmp(command_header, command_list[CMD_SET_BRIGHTNESS][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_BRIGHTNESS][1]) == 0))
led_array->setBrightness(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_SET_ARRAY_DIST][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_ARRAY_DIST][1]) == 0))
led_array->setDistanceZ(argc, (char * *) argv);
Expand Down Expand Up @@ -208,6 +208,10 @@ void CommandRouter::route(char * command_header, int16_t argc, void ** argv, int
led_array->setSequenceValue(argc, argv, argument_led_number_list);
else if ((strcmp(command_header, command_list[CMD_RUN_SEQ_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_RUN_SEQ_IDX][1]) == 0))
led_array->runSequence(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_RUN_SEQ_DPC_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_RUN_SEQ_DPC_IDX][1]) == 0))
led_array->runSequenceDpc(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_RUN_SEQ_FPM_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_RUN_SEQ_FPM_IDX][1]) == 0))
led_array->runSequenceFpm(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_RUN_SEQ_FAST_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_RUN_SEQ_FAST_IDX][1]) == 0))
led_array->runSequenceFast(argc, (char * *) argv);
else if ((strcmp(command_header, command_list[CMD_PRINT_SEQ_IDX][0]) == 0) || (strcmp(command_header, command_list[CMD_PRINT_SEQ_IDX][1]) == 0))
Expand Down Expand Up @@ -269,7 +273,7 @@ void CommandRouter::route(char * command_header, int16_t argc, void ** argv, int
led_array->setPartNumber(strtoul((char *) argv[0], NULL, 0));
else if ((strcmp(command_header, command_list[CMD_SET_PN][0]) == 0) || (strcmp(command_header, command_list[CMD_SET_PN][1]) == 0))
led_array->setSerialNumber(strtoul((char *) argv[0], NULL, 0));

else
{
// Check if the command is equal to any device-specific commands
Expand Down
2 changes: 1 addition & 1 deletion illuminate/illuminate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef ILLUMINATE_H
#define ILLUMINATE_H

#define VERSION 1.14
#define VERSION 1.15

// This file allows the user to define which LED array interface is used. This should be set before compilation.
// The value these are set to does not matter - only that they are defined.
Expand Down
Loading

0 comments on commit 1f0d881

Please sign in to comment.