• MattFox

    Hi Phil, thanks for the quick reply. I'll do some more investigation - could possibly be the format of my data or something of the like. Will let you know of my findings - watch this space!

    posted in How-To read more
  • MattFox

    Looking at implementing a means to send serial data over the web to a mango unit in a different geographical location. My first question is: Is there a specific format the data needs to be or some kind of handshake to make it talk?
    Have tried with a RAW ser2net socket which does connect but no data comes through.
    Would like to be able to implement something like the MangoTCP link if it were possible just as it would make transferring and updating of data much easier.

    Thanks

    Fox

    posted in How-To read more
  • MattFox

    If you could do that I'd be very grateful. Would be good to be able to ignore it if I could.

    posted in User help read more
  • MattFox

    A little confused with an error in the system alarms. Not sure if I should start a new thread or can continue in this one since it relates to the same data and importing code...

    I receive Urgent level errors when importing data that says "Failed to find all expected points", I don't know if this is because it expects all datapoints to be in a single file when it parses them (because each file hosts a different sensor and its readings) or if it's my code, Will add below:

    import java.util.HashMap;
    import java.util.Map;
    
    import org.joda.time.format.DateTimeFormat;
    import org.joda.time.format.DateTimeFormatter;
    
    import com.infiniteautomation.datafilesource.contexts.AbstractCSVDataSource;
    import com.infiniteautomation.datafilesource.dataimage.NumericImportPoint;
    
    public class StreatsCsvImporter extends AbstractCSVDataSource {
    
    	private DateTimeFormatter dtf = DateTimeFormat.forPattern("dd/MM/yyyy hh:mm:ss a");
    	private Map<Integer, String> headerMap = new HashMap<Integer, String>();
    	
    	
    	@Override
    	public void importRow(String[] row, int rowNum) {
    		if( row.length <= 1)
    			return;
    		/* Extract devicename from first line in file */
    		if(rowNum==0)
    		{
    			/* for( int i=0; i<row.length; i++)
    			{
    				System.out.println(row*);
    			}
    				return; */				
    			String loc = row[0].split("=")[1];
    			/* System.out.println(loc); */
    			String deviceName = row[2].split("=")[1];
    			/* System.out.println(deviceName); */
    			this.headerMap.put(0, loc.concat(" - ").concat(deviceName) );
    			/* System.out.println(this.headerMap.get(0) ); */
    			return;
    		}
    		/* extract point names from 2nd column onwards in 2nd line of file */
    		if(rowNum==1)
    		{
    			for(int i=1; i<row.length; i++)
    			{
    				headerMap.put(i,row*);
    			}
    			return;
    		}
    			
    		long dt;
    		String timeString = row[0].replace(":00", ":00:00").replace("a.m.", "AM").replace("p.m.", "PM");
    		/* System.out.print("Timestring: " + timeString + "\n"); */
    		try {
    			dt = dtf.parseDateTime(timeString).getMillis();
    		} catch(Exception e) {
    		//	// Gobble
    			// e.printStackTrace();
    			return;
    		}
    		
    		// /* Extra params option to set deviceName property */
    		Map<String, String> extraParams = new HashMap<String,String>();
    		extraParams.put("deviceName", headerMap.get(0) );
    		
    		for(int i=1; i<row.length; i++)
    		{
    			this.parsedPoints.add(new NumericImportPoint(headerMap.get(i), Double.parseDouble(row*), dt, extraParams));
    		/* this.parsedPoints.add(new NumericImportPoint("DP_T", Double.parseDouble(row[2]), dt, extraParams)); */
    		}
    	}
    
    }
    

    posted in User help read more
  • MattFox

    My first suggestion would be to press F12 to bring up google's console and see if there are errors. Something may be throwing a tizzy and causing the menu to prevent itself from loading.

    posted in User help read more
  • MattFox

    Excellent, I'll give it a crack. Thanks Phil!

    posted in User help read more
  • MattFox

    Would also need to have a way to remember/recall the first few rows to designate the deviceName, name, and XID values if possible...

    posted in User help read more
  • MattFox

    Hi again Phil, would you be willing to explain in further detail how to run this in the console? I need to do some further programming and debugging and would be good to have this working for files that have a different number of logging devices - some have two others one or even three...

    posted in User help read more
  • MattFox

    Ah the "Create Missing Points" tickbox did the job. Never thought to tick that as to me it meant it was adding additional point values into the mix. Maybe if it was named Generate datapoints from file or something to that effect I'd be alright. Non matter, looks like all is working and we're at the end of the proverbial slide!

    Thanks for your patience Phil. Will keep you updated if I run into any other bizarre behaviour.

    posted in User help read more

Looks like your connection to Mango Automation Forum was lost, please wait while we try to reconnect.