The RMP Motion Controller APIs
RapidSequencer.cs
1 using RapidSequencer;
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6 using System.Threading.Tasks;
7 
9 namespace RSI.RapidSequencer
10 {
13 
16  public struct EngineStatus
17  {
18  public bool Running;
19  public SequencerType SequencerType;
20  public ulong TaskCount;
21  }
22 
25  public struct TaskStatus
26  {
27  public TaskState State;
28  public ulong LineNumber;
29  public ulong Counter;
30  }
31 
34  public struct SequencerGlobal
35  {
36  public enum DataType
37  {
38  Bool,
39  Char,
40  Int16,
41  UInt16,
42  Int32,
43  UInt32,
44  Int64,
45  UInt64,
46  Double,
47  }
48 
49  public string Name;
50  public ulong HostAddress;
51  public uint FirmwareAddress;
52  public uint Index;
53  public ulong Size;
54  public DataType Type;
55  public dynamic Value;
56  }
57 
63  public class RapidSequencer
64  {
66  public const uint CONNECT_TIMEOUT_MS = 1000;
67 
69  public const uint CONNECT_ATTEMPTS = 3;
70 
72  public const string DEFAULT_ENTRY_POINT = "main";
73 
74  private Grpc.Core.Channel channel;
75  private RapidSequencerService.RapidSequencerServiceClient client;
76  private string _grpcAddr;
77  private int _grpcPort;
78  private CompileSuccess lastCompileSuccess = null;
79  private string warnings = "";
80 
86  public RapidSequencer(string grpcAddr, int grpcPort, uint connectTimeoutMs = CONNECT_TIMEOUT_MS, uint connectAttempts = CONNECT_ATTEMPTS)
87  {
88  _grpcAddr = grpcAddr;
89  _grpcPort = grpcPort;
90  channel = new Grpc.Core.Channel(_grpcAddr, _grpcPort, Grpc.Core.ChannelCredentials.Insecure);
91 
92  channel.ConnectAsync(DateTime.Now);
93  System.Threading.Thread.Sleep(1);
94 
95  int attempts = 0;
96  while (attempts < connectAttempts && channel.State != Grpc.Core.ChannelState.Ready)
97  {
98  channel.TryWaitForStateChangedAsync(channel.State, DateTime.UtcNow.AddMilliseconds(connectTimeoutMs)).Wait();
99  attempts++;
100  if (attempts >= connectAttempts)
101  {
102  throw new Exception("RapidSequencer failed to transition to ready state");
103  }
104  }
105 
106  client = new RapidSequencerService.RapidSequencerServiceClient(channel);
107  }
108 
111  public int PortGet()
112  {
113  return _grpcPort;
114  }
115 
118  public string IpGet()
119  {
120  return _grpcAddr;
121  }
122 
123  public static string ParseRepeatedString(Google.Protobuf.Collections.RepeatedField<string> result)
124  {
125  string output = "";
126  foreach (var str in result)
127  {
128  output += str + "\n";
129  }
130  return output;
131  }
132 
136  public string CommandLineRun(string command)
137  {
138  var request = new CommandLineRequest { Command = command };
139  var reply = client.CommandLine(request);
140  return ParseRepeatedString(reply.Result);
141  }
142 
149  public CompileSuccess Compile(string path, string entryPoint = DEFAULT_ENTRY_POINT, string exceptionHandler = "")
150  {
151  var request = new CompileRequest { Path = path, EntryPoint = entryPoint, ExceptionHandler = exceptionHandler };
152  var reply = client.Compile(request, null, DateTime.UtcNow.AddSeconds(10));
153  string errorMessage = "Unknown compilation error!";
154  warnings = "";
155  foreach (var str in reply.Warnings)
156  {
157  warnings += str + "\n";
158  }
159 
160  switch (reply.ResultCase)
161  {
162  case CompileReply.ResultOneofCase.CompileSuccess:
163  lastCompileSuccess = reply.CompileSuccess;
164  break;
165  case CompileReply.ResultOneofCase.CompileFailure:
166  var failInfo = reply.CompileFailure;
167  errorMessage =
168  "Compilation Failure: " + failInfo.CompilerText +
169  "\n Message: " + failInfo.CompilerMessage +
170  "\n Line: " + failInfo.CompilerLine + ", character: " + failInfo.CompilerStart;
171  throw new Exception(errorMessage);
172  case CompileReply.ResultOneofCase.GeneralFailure:
173  errorMessage = "Compilation General Failure: " + reply.GeneralFailure;
174  throw new Exception(errorMessage);
175  default:
176  throw new Exception(errorMessage);
177  }
178 
179  return reply.CompileSuccess;
180  }
181 
184  public string WarningsGet()
185  {
186  return warnings;
187  }
188 
189  private string RunCore(CompileSuccess compileSuccess, ulong[] breakpoints, bool block)
190  {
191  if (compileSuccess == null)
192  {
193  throw new Exception("No previously successful compilation found!");
194  }
195  var request = new RunRequest { Block = block, Compiled = compileSuccess, };
196  if (breakpoints != null)
197  {
198  foreach (var breakpoint in breakpoints)
199  {
200  request.Breakpoints.Add(breakpoint);
201  }
202  }
203  var reply = client.Run(request);
204  return reply.Task.Id;
205  }
206 
210  public string Run(ulong[] breakpoints = null)
211  {
212  return RunCore(lastCompileSuccess, breakpoints, true);
213  }
214 
219  public string Run(CompileSuccess compileSuccess, ulong[] breakpoints = null)
220  {
221  return RunCore(compileSuccess, breakpoints, true);
222  }
223 
227  public string RunAsync(ulong[] breakpoints = null)
228  {
229  return RunCore(lastCompileSuccess, breakpoints, false);
230  }
231 
236  public string RunAsync(CompileSuccess compileSuccess, ulong[] breakpoints = null)
237  {
238  return RunCore(compileSuccess, breakpoints, false);
239  }
240 
242  public void Shutdown()
243  {
244  client.Shutdown(new ShutdownRequest());
245  var serverControlClient = new RapidGrpc.ServerControlService.ServerControlServiceClient(channel);
246  serverControlClient.Shutdown(new RapidGrpc.ServerShutdownRequest());
247  }
248 
252  public void EngineStart(string rmpNode = "NodeA", string rmpPath = "")
253  {
254  client.EngineStart(new EngineStartRequest { RmpNode = rmpNode, RmpPath = rmpPath });
255  }
256 
258  public void EngineStop()
259  {
260  client.EngineStop(new EngineStopRequest());
261  }
262 
266  {
267  var reply = client.EngineStatusGet(new EngineStatusRequest());
268  return new EngineStatus { Running = reply.Running, SequencerType = reply.Type, TaskCount = reply.TaskCount, };
269  }
270 
274  public static TaskID TaskIDFromString(string taskId)
275  {
276  return new TaskID { Id = taskId };
277  }
278 
281  public void TaskStop(string taskId)
282  {
283  client.TaskStop(TaskIDFromString(taskId));
284  }
285 
288  public void TaskPause(string taskId)
289  {
290  client.TaskPause(TaskIDFromString(taskId));
291  }
292 
295  public void TaskResume(string taskId)
296  {
297  client.TaskResume(TaskIDFromString(taskId));
298  }
299 
302  public void TaskRemove(string taskId)
303  {
304  var reply = client.TaskRemove(TaskIDFromString(taskId));
305  if (!reply.Result)
306  {
307  throw new Exception($"Failed to remove task: {taskId}. Ensure that task is stopped before removing.");
308  }
309  }
310 
314  public TaskStatus TaskStatusGet(string taskId)
315  {
316  var reply = client.TaskStatusGet(TaskIDFromString(taskId));
317  return new TaskStatus { State = reply.State, LineNumber = reply.LineNumber, Counter = reply.Counter, };
318  }
319 
323  public string TaskOutputGet(string taskId)
324  {
325  var reply = client.TaskOutputGet(TaskIDFromString(taskId));
326  return ParseRepeatedString(reply.Result);
327  }
328 
331  public void DebugResume(string taskId)
332  {
333  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.ResumeUnspecified });
334  }
335 
338  public void DebugPause(string taskId)
339  {
340  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.Pause });
341  }
342 
345  public void DebugStep(string taskId)
346  {
347  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.Step });
348  }
349 
352  public void DebugStepIn(string taskId)
353  {
354  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.StepIn });
355  }
356 
359  public void DebugStepOut(string taskId)
360  {
361  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.StepOut });
362  }
363 
364 
368  public void DebugBreakpointSet(string taskId, ulong lineNumber)
369  {
370  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.BreakpointSet, LineNumber = (int)lineNumber });
371  }
372 
376  public void DebugBreakpointRemove(string taskId, ulong lineNumber)
377  {
378  client.DebugCommand(new DebugRequest { Task = TaskIDFromString(taskId), Action = DebugAction.BreakpointUnset, LineNumber = (int)lineNumber });
379  }
380 
381  private SequencerGlobal ParseGlobalVariableGetReply(GlobalVariableGetReply reply)
382  {
383  var globalVar = new SequencerGlobal
384  {
385  HostAddress = reply.HostAddress,
386  FirmwareAddress = reply.FirmwareAddress,
387  Index = reply.Index
388  };
389 
390  switch (reply.ValueCase)
391  {
392  case GlobalVariableGetReply.ValueOneofCase.Bool:
393  globalVar.Type = SequencerGlobal.DataType.Bool;
394  globalVar.Value = reply.Bool;
395  break;
396  case GlobalVariableGetReply.ValueOneofCase.Char:
397  globalVar.Type = SequencerGlobal.DataType.Char;
398  globalVar.Value = reply.Char;
399  break;
400  case GlobalVariableGetReply.ValueOneofCase.Int16:
401  globalVar.Type = SequencerGlobal.DataType.Int16;
402  globalVar.Value = reply.Int16;
403  break;
404  case GlobalVariableGetReply.ValueOneofCase.Uint16:
405  globalVar.Type = SequencerGlobal.DataType.UInt16;
406  globalVar.Value = reply.Uint16;
407  break;
408  case GlobalVariableGetReply.ValueOneofCase.Int32:
409  globalVar.Type = SequencerGlobal.DataType.Int32;
410  globalVar.Value = reply.Int32;
411  break;
412  case GlobalVariableGetReply.ValueOneofCase.Uint32:
413  globalVar.Type = SequencerGlobal.DataType.UInt32;
414  globalVar.Value = reply.Uint32;
415  break;
416  case GlobalVariableGetReply.ValueOneofCase.Int64:
417  globalVar.Type = SequencerGlobal.DataType.Int64;
418  globalVar.Value = reply.Int64;
419  break;
420  case GlobalVariableGetReply.ValueOneofCase.Uint64:
421  globalVar.Type = SequencerGlobal.DataType.UInt64;
422  globalVar.Value = reply.Uint64;
423  break;
424  case GlobalVariableGetReply.ValueOneofCase.Double:
425  globalVar.Type = SequencerGlobal.DataType.Double;
426  globalVar.Value = reply.Double;
427  break;
428  default:
429  throw new Exception("Unknown data type in GlobalVariableGetReply.");
430  }
431  return globalVar;
432  }
433 
437  public SequencerGlobal GlobalVariableGet(string name)
438  {
439  var request = new GlobalVariableGetRequest { Name = name };
440  var reply = client.GlobalVariableGet(request);
441  var global = ParseGlobalVariableGetReply(reply);
442  global.Name = name;
443  return global;
444  }
445 
446  private SequencerGlobal ParseGlobalVariableData(GlobalVariableData data)
447  {
448  var globalVar = new SequencerGlobal
449  {
450  Name = data.Name,
451  HostAddress = data.HostAddress,
452  FirmwareAddress = data.FirmwareAddress,
453  Index = data.Index,
454  Size = data.Size
455  };
456 
457  switch (data.ValueCase)
458  {
459  case GlobalVariableData.ValueOneofCase.Bool:
460  globalVar.Type = SequencerGlobal.DataType.Bool;
461  globalVar.Value = data.Bool;
462  break;
463  case GlobalVariableData.ValueOneofCase.Char:
464  globalVar.Type = SequencerGlobal.DataType.Char;
465  globalVar.Value = data.Char;
466  break;
467  case GlobalVariableData.ValueOneofCase.Int16:
468  globalVar.Type = SequencerGlobal.DataType.Int16;
469  globalVar.Value = data.Int16;
470  break;
471  case GlobalVariableData.ValueOneofCase.Uint16:
472  globalVar.Type = SequencerGlobal.DataType.UInt16;
473  globalVar.Value = data.Uint16;
474  break;
475  case GlobalVariableData.ValueOneofCase.Int32:
476  globalVar.Type = SequencerGlobal.DataType.Int32;
477  globalVar.Value = data.Int32;
478  break;
479  case GlobalVariableData.ValueOneofCase.Uint32:
480  globalVar.Type = SequencerGlobal.DataType.UInt32;
481  globalVar.Value = data.Uint32;
482  break;
483  case GlobalVariableData.ValueOneofCase.Int64:
484  globalVar.Type = SequencerGlobal.DataType.Int64;
485  globalVar.Value = data.Int64;
486  break;
487  case GlobalVariableData.ValueOneofCase.Uint64:
488  globalVar.Type = SequencerGlobal.DataType.UInt64;
489  globalVar.Value = data.Uint64;
490  break;
491  case GlobalVariableData.ValueOneofCase.Double:
492  globalVar.Type = SequencerGlobal.DataType.Double;
493  globalVar.Value = data.Double;
494  break;
495  default:
496  throw new Exception("Unkown data type in GlobalVariableData.");
497  }
498  return globalVar;
499  }
500 
504  public SequencerGlobal[] GlobalVariableListGet(bool skipValues = false)
505  {
506  var request = new GlobalVariableListGetRequest { SkipValues = skipValues };
507  var reply = client.GlobalVariableListGet(request);
508  List<SequencerGlobal> globals = new List<SequencerGlobal>();
509  foreach (var globalData in reply.Data)
510  {
511  globals.Add(ParseGlobalVariableData(globalData));
512  }
513  return globals.ToArray();
514  }
515 
520  public void GlobalVariableSet(string name, SequencerGlobal.DataType type, dynamic value)
521  {
522  var request = new GlobalVariableSetRequest { Name = name };
523  switch (type)
524  {
525  case SequencerGlobal.DataType.Bool:
526  request.Bool = Convert.ToBoolean(value);
527  break;
528  case SequencerGlobal.DataType.Char:
529  request.Char = Convert.ToChar(value);
530  break;
531  case SequencerGlobal.DataType.Int16:
532  request.Int16 = Convert.ToInt16(value);
533  break;
534  case SequencerGlobal.DataType.UInt16:
535  request.Uint16 = Convert.ToUInt16(value);
536  break;
537  case SequencerGlobal.DataType.Int32:
538  request.Int32 = Convert.ToInt32(value);
539  break;
540  case SequencerGlobal.DataType.UInt32:
541  request.Uint32 = Convert.ToUInt32(value);
542  break;
543  case SequencerGlobal.DataType.Int64:
544  request.Int64 = Convert.ToInt64(value);
545  break;
546  case SequencerGlobal.DataType.UInt64:
547  request.Uint64 = Convert.ToUInt64(value);
548  break;
549  case SequencerGlobal.DataType.Double:
550  request.Double = Convert.ToDouble(value);
551  break;
552  default:
553  throw new Exception("Unkown data type given in GlobalVariableSet().");
554  }
555  client.GlobalVariableSet(request);
556  }
557  }
558 
562  {
563  public const string DEFAULT_SEQUENCER_NODE_NAME = "NodeB";
564  public const string DEFAULT_RMP_NODE_NAME = "NodeA";
565  public const string DEFAULT_IP = "localhost";
566  public const string DEFAULT_MCAST_GROUP = "224.0.0.0";
567  public const int DEFAULT_GRPC_PORT = 50051;
568  public const ulong DEFAULT_TIMEOUT_MS = 1000;
569  public const int DEFAULT_DISCOVER_PORT = 60061;
570 
577  public static RapidSequencer[] Discover(DiscoveryType discoveryType, ushort numExpectedSequencers = 0, string sequencerNodeName = DEFAULT_SEQUENCER_NODE_NAME, ulong timeoutMs = DEFAULT_TIMEOUT_MS, int discoveryPort = DEFAULT_DISCOVER_PORT)
578  {
579  ServerInfoCollection result;
580  if (discoveryType == DiscoveryType.All)
581  {
582  result = API.DiscoverBroadcast(discoveryType, numExpectedSequencers, sequencerNodeName, timeoutMs, discoveryPort);
583  }
584  else if (discoveryType == DiscoveryType.Local_Intime)
585  {
586  result = API.DiscoverLocalINtime(sequencerNodeName);
587  }
588  else if (discoveryType == DiscoveryType.Local_Windows)
589  {
590  result = API.DiscoverLocalWindows();
591  }
592  else
593  {
594  result = API.DiscoverLocal(sequencerNodeName);
595  }
596 
597 
598  var foundSequencers = new List<RapidSequencer>();
599  for (uint index = 0; index < result.ServerCount(); index++)
600  {
601  try
602  {
603  //foundSequencers.Add(new RapidSequencer(addresses[index], ports[index]));
604 
605  var sequencerInfo = result.ServerInfoGet(index);
606  foundSequencers.Add(new RapidSequencer(sequencerInfo.AddressGet(), sequencerInfo.PortGet()));
607  }
608  catch
609  {
610  // something happened to the seqeuncer or the grpc channel failed for some reason? Just don't add it to the list?
611  // For now, I will just not add a sequencer to the list if the Constructor throws an exception due to the grpc channels not being set up properly
612  }
613  }
614 
615  return foundSequencers.ToArray();
616  }
617 
630  public static RapidSequencer Create(Platform platform, string sequencerNodeName, string rmpNodeName, string executablePath,
631  int grpcPort = DEFAULT_GRPC_PORT, string friendlyName = "RapidServer", ulong timeoutMs = DEFAULT_TIMEOUT_MS, int discoveryPort = DEFAULT_DISCOVER_PORT)
632  {
633  //int sequencerCount = 10;
634  //int addressSize = 46;
635  //string[] addresses = new string[sequencerCount];
636  //int[] ports = new int[sequencerCount];
637  //int usedElements;
638  //int foundIndex;
639 
640  //var result = RSI.RapidSequencer.API.CreateStart(platform, sequencerNodeName, rmpNodeName, executablePath, ref addresses, sequencerCount, addressSize,
641  // ports, sequencerCount, out usedElements, out foundIndex, timeoutMs, (int)grpcPort, friendlyName, mcastGroup, (int)mcastPort);
642 
643  //if (result == CreateDiscoverResult.OK && usedElements > 0 && foundIndex > -1)
644  //{
645  // var sequencer = new RapidSequencer(addresses[foundIndex], ports[foundIndex]);
646  // sequencer.EngineStart();
647  // return sequencer;
648  //}
649  //else
650  //{
651  // string errorMessage = $"Failed to create a new sequencer at port: {grpcPort}. ";
652  // switch (result)
653  // {
654  // case CreateDiscoverResult.DiscoveryTimeout:
655  // errorMessage += "Discovery timed out.";
656  // break;
657  // case CreateDiscoverResult.ExecutableDNE:
658  // errorMessage += "Executable could not be found.";
659  // break;
660  // case CreateDiscoverResult.ExecutableFailure:
661  // errorMessage += "Executable failure.";
662  // break;
663  // case CreateDiscoverResult.UnknownINtimeNode:
664  // errorMessage += "Unknown INtime node.";
665  // break;
666  // case CreateDiscoverResult.UnknownPlatform:
667  // errorMessage += "Unknown platform.";
668  // break;
669  // }
670  // throw new Exception(errorMessage);
671  //}
672 
673  var result = RSI.RapidSequencer.API.Start(platform, sequencerNodeName, rmpNodeName, executablePath, grpcPort, friendlyName, timeoutMs, discoveryPort);
674  return new RapidSequencer(result.AddressGet(), result.PortGet());
675  }
676 
688  public static RapidSequencer CreateWindows(string sequencerNodeName, string rmpNodeName, string executablePath, int grpcPort = DEFAULT_GRPC_PORT,
689  string friendlyName = "RapidServer", ulong timeoutMs = DEFAULT_TIMEOUT_MS, int discoveryPort = DEFAULT_DISCOVER_PORT)
690  {
691  return Create(Platform.Windows, sequencerNodeName, rmpNodeName, executablePath, grpcPort, friendlyName, timeoutMs, discoveryPort);
692  }
693 
705  public static RapidSequencer CreateRT(string sequencerNodeName, string rmpNodeName, string executablePath, int grpcPort = DEFAULT_GRPC_PORT,
706  string friendlyName = "RapidServer", ulong timeoutMs = DEFAULT_TIMEOUT_MS, int discoveryPort = DEFAULT_DISCOVER_PORT)
707  {
708  return Create(Platform.INtime, sequencerNodeName, rmpNodeName, executablePath, grpcPort, friendlyName, timeoutMs, discoveryPort);
709  }
710  }
711 
713 }
RSI::RapidSequencer.RapidSequencerFactory.Create
static RapidSequencer Create(Platform platform, string sequencerNodeName, string rmpNodeName, string executablePath, int grpcPort=DEFAULT_GRPC_PORT, string friendlyName="RapidServer", ulong timeoutMs=DEFAULT_TIMEOUT_MS, int discoveryPort=DEFAULT_DISCOVER_PORT)
Creates a RapidSequencer process on the given platform at the specified port if one does not already ...
Definition: RapidSequencer.cs:630
RSI::RapidSequencer.RapidSequencer.CONNECT_TIMEOUT_MS
const uint CONNECT_TIMEOUT_MS
The default timeout for creating a connection is 1000 milliseconds.
Definition: RapidSequencer.cs:66
RSI::RapidSequencer.RapidSequencer.TaskIDFromString
static TaskID TaskIDFromString(string taskId)
Creates a TaskID object from the given string.
Definition: RapidSequencer.cs:274
RSI::RapidSequencer.RapidSequencer.EngineStatusGet
EngineStatus EngineStatusGet()
Gets the status of the RapidSequencer process.
Definition: RapidSequencer.cs:265
RSI::RapidSequencer.RapidSequencer.PortGet
int PortGet()
Returns the port the RapidSequencer proecess is listening on.
Definition: RapidSequencer.cs:111
RSI::RapidSequencer.RapidSequencer.CONNECT_ATTEMPTS
const uint CONNECT_ATTEMPTS
The default number of connection attempts to make during object construction.
Definition: RapidSequencer.cs:69
RSI::RapidSequencer.RapidSequencer.DebugBreakpointRemove
void DebugBreakpointRemove(string taskId, ulong lineNumber)
Removes any breakpoints at the given line number in the specified task.
Definition: RapidSequencer.cs:376
RSI::RapidSequencer.SequencerGlobal
Structure for describing a global tag. Contains information about the type, name, and value of the ta...
Definition: RapidSequencer.cs:35
RSI::RapidSequencer
RSI::RapidSequencer.RapidSequencer.DebugStepIn
void DebugStepIn(string taskId)
Enters the called function at the current line of the specified task. If unable to enter a function,...
Definition: RapidSequencer.cs:352
RSI::RapidSequencer.EngineStatus
Structure for describing the status of the RapidSequencer proccess. Describes whether the process is ...
Definition: RapidSequencer.cs:17
RSI::RapidSequencer.TaskStatus
Structure for describing the status of a task. Describes what state the task is in,...
Definition: RapidSequencer.cs:26
RSI::RapidSequencer.RapidSequencer.WarningsGet
string WarningsGet()
Returns the warnings from the last compilation the RapidSequencer performed.
Definition: RapidSequencer.cs:184
RSI::RapidSequencer::API::Platform
Platform
Enum for which platform / operating system to run RapidServer on.
Definition: RapidSequencerAPI.h:27
RSI::RapidSequencer.RapidSequencer.TaskStatusGet
TaskStatus TaskStatusGet(string taskId)
Gets the status of the specified task as a TaskStatus struct.
Definition: RapidSequencer.cs:314
RSI::RapidSequencer.RapidSequencer.TaskRemove
void TaskRemove(string taskId)
Removes the specified task. Task must be stopped to be removed, throws an exception if the removal fa...
Definition: RapidSequencer.cs:302
RSI::RapidSequencer::API::DiscoveryType
DiscoveryType
Enum for which platform / operating system to discover RapidServer instances on.
Definition: RapidSequencerAPI.h:38
RSI::RapidSequencer.RapidSequencer.TaskResume
void TaskResume(string taskId)
Resumes the specified task.
Definition: RapidSequencer.cs:295
RSI::RapidSequencer.RapidSequencer.DebugStepOut
void DebugStepOut(string taskId)
Exits the execution of the currently executing function in the specified task. Pauses at the line the...
Definition: RapidSequencer.cs:359
RSI::RapidSequencer.RapidSequencer.CommandLineRun
string CommandLineRun(string command)
Command the RapidSequencer to execute a given line and return the output.
Definition: RapidSequencer.cs:136
RSI::RapidSequencer.RapidSequencer.Compile
CompileSuccess Compile(string path, string entryPoint=DEFAULT_ENTRY_POINT, string exceptionHandler="")
Compiles the script at the given path. If successful, saves this compilation result to run at a later...
Definition: RapidSequencer.cs:149
RSI::RapidSequencer.RapidSequencer.RunAsync
string RunAsync(CompileSuccess compileSuccess, ulong[] breakpoints=null)
Run the script using the given compilation result. Does not wait for the script to finish excecution....
Definition: RapidSequencer.cs:236
RSI::RapidSequencer.RapidSequencer.IpGet
string IpGet()
Returns the IPv4 address the RapidSequencer process is located at.
Definition: RapidSequencer.cs:118
RSI::RapidSequencer.RapidSequencer.Shutdown
void Shutdown()
Shuts down the RapidSequencer process.
Definition: RapidSequencer.cs:242
RSI::RapidSequencer.RapidSequencer.TaskOutputGet
string TaskOutputGet(string taskId)
Gets the string output of the specified task.
Definition: RapidSequencer.cs:323
RSI::RapidSequencer.RapidSequencerFactory.CreateWindows
static RapidSequencer CreateWindows(string sequencerNodeName, string rmpNodeName, string executablePath, int grpcPort=DEFAULT_GRPC_PORT, string friendlyName="RapidServer", ulong timeoutMs=DEFAULT_TIMEOUT_MS, int discoveryPort=DEFAULT_DISCOVER_PORT)
Creates a Windows RapidSequencer process at the specified port if one does not already exist....
Definition: RapidSequencer.cs:688
RSI::RapidSequencer.RapidSequencer.DebugBreakpointSet
void DebugBreakpointSet(string taskId, ulong lineNumber)
Places a breakpoint at the given line number in the specified task.
Definition: RapidSequencer.cs:368
RSI::RapidSequencer.RapidSequencerFactory.CreateRT
static RapidSequencer CreateRT(string sequencerNodeName, string rmpNodeName, string executablePath, int grpcPort=DEFAULT_GRPC_PORT, string friendlyName="RapidServer", ulong timeoutMs=DEFAULT_TIMEOUT_MS, int discoveryPort=DEFAULT_DISCOVER_PORT)
Creates a real-time RapidSequencer process at the specified port if one does not already exist....
Definition: RapidSequencer.cs:705
RSI::RapidSequencer.RapidSequencer.GlobalVariableGet
SequencerGlobal GlobalVariableGet(string name)
Gets the value of the global variable with the given name.
Definition: RapidSequencer.cs:437
RSI
RSI::RapidSequencer.RapidSequencer.DEFAULT_ENTRY_POINT
const string DEFAULT_ENTRY_POINT
The name of the default function the RapidSequencer will use when running a script.
Definition: RapidSequencer.cs:72
RSI::RapidSequencer.RapidSequencer.RunAsync
string RunAsync(ulong[] breakpoints=null)
Run the last compiled script. Does not wait for the script to finish excecution. Returns the ID of th...
Definition: RapidSequencer.cs:227
RSI::RapidSequencer.RapidSequencer.TaskPause
void TaskPause(string taskId)
Pauses the specified task.
Definition: RapidSequencer.cs:288
RSI::RapidSequencer.RapidSequencer.DebugPause
void DebugPause(string taskId)
Pauses the specified task.
Definition: RapidSequencer.cs:338
RSI::RapidSequencer.RapidSequencer.DebugResume
void DebugResume(string taskId)
Resumes the specified task.
Definition: RapidSequencer.cs:331
RSI::RapidSequencer.RapidSequencer.Run
string Run(ulong[] breakpoints=null)
Run the last compiled script. Waits for the script to finish execution. Returns the ID of the resulti...
Definition: RapidSequencer.cs:210
RSI::RapidSequencer.RapidSequencerFactory.Discover
static RapidSequencer[] Discover(DiscoveryType discoveryType, ushort numExpectedSequencers=0, string sequencerNodeName=DEFAULT_SEQUENCER_NODE_NAME, ulong timeoutMs=DEFAULT_TIMEOUT_MS, int discoveryPort=DEFAULT_DISCOVER_PORT)
Discovers existing RapidSequencer processes and returns an array of RapidSequencer objects to interfa...
Definition: RapidSequencer.cs:577
RSI::RapidSequencer.RapidSequencer.DebugStep
void DebugStep(string taskId)
Proceeds to the next line of the specified task and pauses.
Definition: RapidSequencer.cs:345
RSI::RapidSequencer.RapidSequencerFactory
The RapidSequencerFactory provides static methods for creating RapidSequencer processes or discoverin...
Definition: RapidSequencer.cs:562
RSI::RapidSequencer.RapidSequencer.TaskStop
void TaskStop(string taskId)
Stops the specified task.
Definition: RapidSequencer.cs:281
RSI::RapidSequencer.RapidSequencer
An object for interacting with a RapidSequencer process.
Definition: RapidSequencer.cs:64
RSI::RapidSequencer.RapidSequencer.RapidSequencer
RapidSequencer(string grpcAddr, int grpcPort, uint connectTimeoutMs=CONNECT_TIMEOUT_MS, uint connectAttempts=CONNECT_ATTEMPTS)
Constructs a RapidSequencer object.
Definition: RapidSequencer.cs:86
RSI::RapidSequencer.RapidSequencer.EngineStop
void EngineStop()
Stops the runtime of the RapidSequencer process.
Definition: RapidSequencer.cs:258
RSI::RapidSequencer.RapidSequencer.GlobalVariableListGet
SequencerGlobal[] GlobalVariableListGet(bool skipValues=false)
Gets the status of the global variables.
Definition: RapidSequencer.cs:504
RSI::RapidSequencer::API
RSI::RapidSequencer.RapidSequencer.Run
string Run(CompileSuccess compileSuccess, ulong[] breakpoints=null)
Run the script using the given compilation result. Waits for the script to finish execution....
Definition: RapidSequencer.cs:219
RSI::RapidSequencer.RapidSequencer.GlobalVariableSet
void GlobalVariableSet(string name, SequencerGlobal.DataType type, dynamic value)
Sets the value of the specified global variable.
Definition: RapidSequencer.cs:520
RSI::RapidSequencer.RapidSequencer.EngineStart
void EngineStart(string rmpNode="NodeA", string rmpPath="")
Starts the runtime of the RapidSequencer process.
Definition: RapidSequencer.cs:252