FACT++  1.0
unsigned int setDeadbandBroadcast ( char *  name,
float  newDeadbandBC 
)

Definition at line 2858 of file feeserver.c.

References count, firstIntNode, and firstNode.

Referenced by setDeadband().

2858  {
2859  unsigned int count = 0;
2860  ItemNode* current = 0;
2861  IntItemNode* intCurrent = 0;
2862  char* namePart = 0;
2863  char* itemNamePart = 0;
2864 
2865  if (name == 0) {
2866  return count;
2867  }
2868 
2869  // pointer at first occurance of "_"
2870  namePart = strpbrk(name, "_");
2871  if (namePart == 0) {
2872  return count;
2873  }
2874 
2875  // go through list of float values
2876  current = firstNode;
2877  while (current != 0) { // is end of list
2878  // pointer at first occurance of "_"
2879  itemNamePart = strpbrk(current->item->name, "_");
2880  // check if "_" not first character in name and is existing
2881  if ((itemNamePart == 0) || (itemNamePart == current->item->name)) {
2882  current = current->next;
2883  continue;
2884  }
2885  if (strcmp(namePart, itemNamePart) == 0) {
2886  // success, set threshold (= deadband / 2)
2887  current->threshold = newDeadbandBC / 2;
2888  ++count;
2889  }
2890  current = current->next;
2891  }
2892 
2893  // go through list of integer values
2894  intCurrent = firstIntNode;
2895  while (intCurrent != 0) { // is end of list
2896  // pointer at first occurance of "_"
2897  itemNamePart = strpbrk(intCurrent->intItem->name, "_");
2898  // check if "_" not first character in name and is existing
2899  if ((itemNamePart == 0) || (itemNamePart == intCurrent->intItem->name)) {
2900  intCurrent = intCurrent->next;
2901  continue;
2902  }
2903  if (strcmp(namePart, itemNamePart) == 0) {
2904  // success, set threshold (= deadband / 2)
2905  intCurrent->threshold = newDeadbandBC / 2;
2906  ++count;
2907  }
2908  intCurrent = intCurrent->next;
2909  }
2910 
2911  return count;
2912 }
static IntItemNode * firstIntNode
Definition: feeserver.c:281
static ItemNode * firstNode
Definition: feeserver.c:89
int count
Definition: db_dim_server.c:18

+ Here is the caller graph for this function: