-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from analogdevicesinc/namedRepeaters
session save&restore, and configuration persistence. closes #21.
- Loading branch information
Showing
12 changed files
with
135 additions
and
24 deletions.
There are no files selected for viewing
Submodule libsmu
updated
from a2c5d0 to 8149ef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
var saveState = function () { | ||
var signalStates = {}; | ||
for (var a = 0; a < deviceRepeater.count; a++){ | ||
var deviceItem = deviceRepeater.itemAt(a); | ||
for (var b = 0; b < deviceItem.channelRepeater.count; b++){ | ||
var channelItem = deviceItem.channelRepeater.itemAt(b); | ||
var channel = channelItem.channel; | ||
for (var c = 0; c < channelItem.signalRepeater.count; c++) { | ||
var label = '' + a + session.devices[a].channels[b].label +"_"+ session.devices[a].channels[b].signals[c].label; | ||
var signalState = {}; | ||
var signalItem = channelItem.signalRepeater.itemAt(c); | ||
var signal = signalItem.signal; | ||
signalState.src = signal.src.src; | ||
signalState.v1 = signal.src.v1; | ||
signalState.v2 = signal.src.v2; | ||
signalState.period = signal.src.period; | ||
signalState.phase = signal.src.phase; | ||
signalState.duty = signal.src.duty; | ||
signalState.xscale = signalItem.xaxis.xscale; | ||
signalState.ymin = signalItem.ymin; | ||
signalState.ymax = signalItem.ymax; | ||
signalState.mode = channel.mode; | ||
signalStates[label] = signalState; | ||
} | ||
} | ||
} | ||
return signalStates; | ||
}; | ||
|
||
|
||
var restoreState = function (signalStates){ | ||
for (var a = 0; a < deviceRepeater.count; a++){ | ||
var deviceItem = deviceRepeater.itemAt(a); | ||
for (var b = 0; b < deviceItem.channelRepeater.count; b++){ | ||
var channelItem = deviceItem.channelRepeater.itemAt(b); | ||
var channel = channelItem.channel; | ||
for (var c = 0; c < channelItem.signalRepeater.count; c++) { | ||
var label = '' + a + session.devices[a].channels[b].label +"_"+ session.devices[a].channels[b].signals[c].label; | ||
var signalItem = channelItem.signalRepeater.itemAt(c); | ||
var signalState = signalStates[label]; | ||
var signal = signalItem.signal; | ||
channel.mode = signalState.mode; | ||
signal.src.src = signalState.src; | ||
signal.src.v1 = signalState.v1; | ||
signal.src.v2 = signalState.v2; | ||
signal.src.period = signalState.period; | ||
signal.src.phase = signalState.phase; | ||
signal.src.duty = signalState.duty; | ||
signalItem.ymin = signalState.ymin; | ||
signalItem.ymax = signalState.ymax; | ||
signalItem.xaxis.xscale = signalState.xscale; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters