BowlerKernel
BowlerDocumentationFactory.java
Go to the documentation of this file.
1 package com.neuronrobotics.sdk.common;
2 
3 import java.net.URI;
4 import java.net.URISyntaxException;
5 
6 import com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel;
7 import com.neuronrobotics.sdk.dyio.peripherals.CounterInputChannel;
8 import com.neuronrobotics.sdk.dyio.peripherals.CounterOutputChannel;
9 import com.neuronrobotics.sdk.dyio.peripherals.DigitalInputChannel;
10 import com.neuronrobotics.sdk.dyio.peripherals.DigitalOutputChannel;
11 import com.neuronrobotics.sdk.dyio.peripherals.PPMReaderChannel;
12 import com.neuronrobotics.sdk.dyio.peripherals.SPIChannel;
13 import com.neuronrobotics.sdk.dyio.peripherals.ServoChannel;
14 import com.neuronrobotics.sdk.dyio.peripherals.UARTChannel;
15 
16 // TODO: Auto-generated Javadoc
27 
34  public static URI getDocumentationURL(Object input) {
35  String basURL = "http://neuronrobotics.github.io/Java-Code-Library/";
36  if (input instanceof DigitalInputChannel) {
37 
38  try {
39  return new URI(
40  basURL+"Digital-Input-Example-Simple/");
41  } catch (URISyntaxException e) {
42  Log.error(e.getMessage());
43  }
44 
45  } else if (input instanceof AnalogInputChannel) {
46 
47  try {
48  return new URI(
49  basURL+"Analog-Input-Example/");
50  } catch (URISyntaxException e) {
51  Log.error(e.getMessage());
52  }
53  } else if (input instanceof CounterInputChannel) {
54 
55  try {
56  return new URI(
57  basURL+"Counter-Input-Quadrature-Encoder-Example/");
58  } catch (URISyntaxException e) {
59  Log.error(e.getMessage());
60  }
61  } else if (input instanceof CounterOutputChannel) {
62 
63  try {
64  return new URI(
65  basURL+"Counter-Output-Stepper-Example/");
66  } catch (URISyntaxException e) {
67  Log.error(e.getMessage());
68  }
69  } else if (input instanceof DigitalOutputChannel) {
70 
71  try {
72  return new URI(
73  basURL+"Digital-Output-Example/");
74  } catch (URISyntaxException e) {
75  Log.error(e.getMessage());
76  }
77  } else if (input instanceof PPMReaderChannel) {
78 
79  try {
80  return new URI(
81  basURL+"PPM-RC-Signal-Reader-Channle-Example/");
82  } catch (URISyntaxException e) {
83  Log.error(e.getMessage());
84  }
85  } else if (input instanceof ServoChannel) {
86 
87  try {
88  return new URI(basURL+"Servo-Output-Example/");
89  } catch (URISyntaxException e) {
90  Log.error(e.getMessage());
91  }
92  } else if (input instanceof SPIChannel) {
93 
94  try {
95  return new URI(
96  basURL+"SPI-Channel-Example/");
97  } catch (URISyntaxException e) {
98  Log.error(e.getMessage());
99  }
100  } else if (input instanceof UARTChannel) {
101 
102  try {
103  return new URI(
104  basURL+"USART-Channel-Example/");
105  } catch (URISyntaxException e) {
106  Log.error(e.getMessage());
107  }
108  }
109 
110  throw new RuntimeException("No documentation for object of type "
111  + input.getClass());
112 
113  }
114 }
static void error(String message)
Definition: Log.java:92