SignalK / signalk-server-java

DEPRECATED - see https://github.com/SignalK/signalk-java
Apache License 2.0
6 stars 9 forks source link

SignalK must be restarted twice when signalk-config.json and self.json are both absent. #37

Closed RBerliner closed 7 years ago

RBerliner commented 7 years ago

Initialization of SignalK

With the production code, if self.json and signalk-config.json both do not exist, a signalk-config.json file is produced that contains the parameters defined in Util.setDefaults(). The file self.json however is just a stub. It is reproduced below:

{ "resources": { "routes": { "urn:mrn:signalk:uuid:44d8be5e-609f-4416-9192-85bcb006bddb": { "description": "Auto saved vessel track from 2017-03-02T02:31:42", "feature": [ { "geometry": { "coordinates": [], "type": "LineString" }, "id": "na", "properties": null, "type": "Feature" } ], "name": "Vessel Track from 2017-03-02T02:31:42", "source": { "internal": { "$source": "unknown", "timestamp": "2017-03-02T02:31:42.982Z", "value": "TrackProcessor" } }, "timestamp": "2017-03-02T02:31:42.982Z" } } }, "vessels": { "self": { "uuid": "urn:mrn:signalk:uuid:76db5037-88d2-4b94-a7eb-92be979cf977" } } }

Going to the server tab and pressing the Restart Server button makes no change to self.json.

If the program is halted and restarted, self.json is then populated to reflect the parms set in Util.setDefaults().

If the Configuration Panel is used to change the configuration parameters these parameters will not be reflected in self.json until the program has once again been stopped and restarted.

rob42 commented 7 years ago

Merged in your PR, renamed insertConfig() to insertMetaToModel(model) and moved into load(), not loadConfig().

I dont see the behaviour above anymore. Pls reopen if its still a problem