Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Commit

Permalink
Instance improvements
Browse files Browse the repository at this point in the history
* Better event handling by binding class methods
* Removing event listeners when disconnecting
* Closing GRPC connections savely
* Removing connector instances savely
* Better handling of shutting down the Inexor Core process 
* Load instance configuration from TOML
* The logging of each connector can be configured separately
* Tree nodes can be removed even if read only
  • Loading branch information
aschaeffer committed Jun 17, 2017
1 parent 7550eb0 commit 6254bcf
Show file tree
Hide file tree
Showing 8 changed files with 454 additions and 129 deletions.
8 changes: 8 additions & 0 deletions config/client/31417.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Configure the wall clock
wallclock = 1
wallclock24 = 1
wallclocksecs = 1

[rendering.screen]
fullscreen = 1

4 changes: 4 additions & 0 deletions config/client/logging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ level = "warn"

level = "info"

[logging.flex.instances.Connector]

level = "warn"

[logging.flex.profiles.ProfileManager]

level = "info"
8 changes: 8 additions & 0 deletions config/devenv/31417.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Make visual that we're using the devenv profile
crosshairsize = 200

[rendering.screen]
fullscreen = 0
scr_w = 800
scr_h = 600

4 changes: 4 additions & 0 deletions config/devenv/logging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ level = "warn"

level = "info"

[logging.flex.instances.Connector]

level = "debug"

[logging.flex.profiles.ProfileManager]

level = "warn"
Expand Down
33 changes: 33 additions & 0 deletions server/api/v1/InexorTreeRestAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class InexorTreeRestAPI {

/**
* Converts an incoming string value to the target datatype.
* TODO: move to tree utils
*/
convert(datatype, value) {
if (typeof value == 'string') {
Expand All @@ -160,6 +161,38 @@ class InexorTreeRestAPI {
// timestamp, object, node,
return null;
}
} else if (typeof value == 'number') {
switch (datatype) {
case 'int32':
case 'int64':
case 'enum':
case 'float':
return value;
case 'bool':
return value == 1 ? true : false;
case 'string':
return value.toString();
default:
// timestamp, object, node,
return null;
}
} else if (typeof value == 'boolean') {
switch (datatype) {
case 'int32':
case 'int64':
case 'enum':
case 'float':
return value ? 1 : 0;
case 'bool':
return value;
case 'string':
return value.toString();
default:
// timestamp, object, node,
return null;
}
} else {
return null;
}
}

Expand Down
Loading

0 comments on commit 6254bcf

Please sign in to comment.