Go to Post At the Chesapeake Regional, we will be weighing any team that brings in a kitchen sink (or other major appliances) or an extra robot... - RoboMom [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-08-2012, 01:25
josh.pruim josh.pruim is offline
Registered User
FRC #4014
Team Role: Programmer
 
Join Date: Aug 2012
Rookie Year: 2011
Location: United States
Posts: 36
josh.pruim will become famous soon enough
Determining if code is on cRIO

Hello, I was wondering if there is a good way to determine whether or not the code is running on the cRIO. Since I do not have the cRIO with me, I wrote an if statement that I am guessing would work.

It will return true if it is on the cRIO, false if on a PC/Mac.

Code:
//Lines 2-8 on LimitSwitches/NICompactRIOToolkit.java
public boolean iscRIO(){
		if(System.getProperty("os.arch").contains("amd64") || System.getProperty("os.arch").contains("x86_64") || System.getProperty("os.arch").contains("x86") || System.getProperty("os.arch").contains("i386")){
			return false;
		}else{
			return true;
		}
	}
EDIT: Code is on GitHub, this specific class is here
https://github.com/itguy51/RobotClas...IOToolkit.java


Side note: If anyone knows where to get the WPILibJ libraries as a binary, [.jar or otherwise], that would be very helpful

Last edited by josh.pruim : 17-08-2012 at 01:28. Reason: Added Github Link
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi