@complat/react-spectra-editor 1.0.0-rc4.alpha.0 → 1.0.0-rc6.alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,7 +89,8 @@ const INTEGRATION = {
|
|
|
89
89
|
SET_REF: 'INTEGRATION_SET_REF',
|
|
90
90
|
SET_FKR: 'INTEGRATION_SET_FKR',
|
|
91
91
|
RESET_ALL_RDC: 'INTEGRATION_RESET_ALL_RDC',
|
|
92
|
-
CLEAR_ALL: 'INTEGRATION_CLEAR_ALL'
|
|
92
|
+
CLEAR_ALL: 'INTEGRATION_CLEAR_ALL',
|
|
93
|
+
SWEEP: 'INTEGRATION_SWEEP'
|
|
93
94
|
};
|
|
94
95
|
exports.INTEGRATION = INTEGRATION;
|
|
95
96
|
const SIMULATION = {
|
|
@@ -59,21 +59,36 @@ const resetEnable = payload => {
|
|
|
59
59
|
};
|
|
60
60
|
const resetShift = (state, action) => {
|
|
61
61
|
const {
|
|
62
|
-
|
|
62
|
+
payload
|
|
63
|
+
} = action;
|
|
64
|
+
const {
|
|
65
|
+
isMultiCurve,
|
|
66
|
+
curveIdx,
|
|
67
|
+
numberOfCurve
|
|
68
|
+
} = payload;
|
|
69
|
+
const {
|
|
63
70
|
shifts
|
|
64
71
|
} = state;
|
|
65
|
-
let selectedShift = shifts[
|
|
72
|
+
let selectedShift = shifts[curveIdx];
|
|
66
73
|
if (selectedShift === false || selectedShift === undefined) {
|
|
67
74
|
selectedShift = defaultEmptyShift;
|
|
68
75
|
}
|
|
76
|
+
if (isMultiCurve) {
|
|
77
|
+
for (let idx = 0; idx < numberOfCurve; idx += 1) {
|
|
78
|
+
const checkShift = shifts[idx];
|
|
79
|
+
if (checkShift === false || checkShift === undefined) {
|
|
80
|
+
shifts[idx] = defaultEmptyShift;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
69
84
|
const newShift = Object.assign({}, selectedShift, {
|
|
70
|
-
ref: resetRef(
|
|
71
|
-
enable: resetEnable(
|
|
85
|
+
ref: resetRef(payload),
|
|
86
|
+
enable: resetEnable(payload)
|
|
72
87
|
});
|
|
73
|
-
shifts[
|
|
88
|
+
shifts[curveIdx] = newShift;
|
|
74
89
|
return Object.assign({}, state, {
|
|
75
90
|
shifts,
|
|
76
|
-
selectedIdx
|
|
91
|
+
selectedIdx: curveIdx
|
|
77
92
|
});
|
|
78
93
|
};
|
|
79
94
|
const updateShift = (state, action) => {
|
|
@@ -9,31 +9,28 @@ var _action_type = require("../constants/action_type");
|
|
|
9
9
|
const getLayout = state => state.layout;
|
|
10
10
|
const getCurveSt = state => state.curve;
|
|
11
11
|
const getIntegrationSt = state => state.integration.present;
|
|
12
|
-
// const getShiftSt = (state) => state.shift;
|
|
13
|
-
|
|
14
12
|
function* resetShift(action) {
|
|
15
|
-
|
|
13
|
+
const curveSt = yield (0, _effects.select)(getCurveSt);
|
|
16
14
|
const layout = yield (0, _effects.select)(getLayout);
|
|
17
|
-
// const shiftSt = yield select(getShiftSt);
|
|
18
|
-
|
|
19
15
|
const {
|
|
20
16
|
payload
|
|
21
17
|
} = action;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// shifts[curveIdx] = shift;
|
|
28
|
-
|
|
29
|
-
// const newPayload = Object.assign({}, shiftSt, { shifts, selectedIdx: curveIdx })
|
|
30
|
-
|
|
18
|
+
const {
|
|
19
|
+
curveIdx,
|
|
20
|
+
listCurves
|
|
21
|
+
} = curveSt;
|
|
22
|
+
const numberOfCurve = listCurves.length;
|
|
31
23
|
yield (0, _effects.put)({
|
|
32
24
|
type: _action_type.MANAGER.RESETSHIFT,
|
|
33
25
|
payload: Object.assign(
|
|
34
26
|
// eslint-disable-line
|
|
35
27
|
{}, payload, {
|
|
36
|
-
layout
|
|
28
|
+
layout,
|
|
29
|
+
curvesInfo: {
|
|
30
|
+
isMultiCurve: numberOfCurve > 0,
|
|
31
|
+
curveIdx,
|
|
32
|
+
numberOfCurve
|
|
33
|
+
}
|
|
37
34
|
})
|
|
38
35
|
});
|
|
39
36
|
}
|
package/package.json
CHANGED