Skip to content

Commit 37fee6b

Browse files
Track source limit by power envelop (#40)
Handle for the case of over range
1 parent 706550e commit 37fee6b

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

kic-script-gen/src/back_end/data_model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl DataModel {
7272
// Deserialize the JSON string into a serde_json::Value
7373
match serde_json::from_str::<SweepModel>(&data) {
7474
Ok(mut sweep_model) => {
75-
println!("Successfully deserialized JSON in server: {sweep_model:?}");
75+
//println!("Successfully deserialized JSON in server: {sweep_model:?}");
7676
sweep_model.sweep_config.evaluate();
7777

7878
//update sweep variable - required for actual script generation
@@ -135,7 +135,7 @@ impl DataModel {
135135
pub fn add_remove_channel(&mut self, ipc_data: IpcData) -> String {
136136
match serde_json::from_str::<SweepModel>(ipc_data.json_value.as_str()) {
137137
Ok(mut sweep_model) => {
138-
println!("Successfully deserialized JSON in server: {sweep_model:?}");
138+
//println!("Successfully deserialized JSON in server: {sweep_model:?}");
139139

140140
sweep_model.sweep_config.update_channel_devices();
141141
let res: Vec<&str> = ipc_data.additional_info.split(',').collect();

script-gen-manager/src/instr_metadata/mpsu50_metadata.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,20 @@ impl Mpsu50Metadata {
4747
region_map_metadata.add_region(1, 0.0, 0.0, 10.0, max_supported_current);
4848
region_map_metadata.add_region(1, 0.0, 0.0, -10.0, -max_supported_current);
4949

50-
Self::add_1st_quadrant_curved_region(10.0, 50.0, 0.001, 0.0, &mut region_map_metadata); //First quadrant curve
51-
Self::add_3rd_quadrant_curved_region(-10.0, -50.0, -0.001, 0.0, &mut region_map_metadata); //Third quadrant curve
50+
Self::add_1st_quadrant_curved_region(
51+
10.0,
52+
max_supported_voltage,
53+
0.0001,
54+
0.0,
55+
&mut region_map_metadata,
56+
); //First quadrant curve
57+
Self::add_3rd_quadrant_curved_region(
58+
-10.0,
59+
-max_supported_voltage,
60+
-0.0001,
61+
0.0,
62+
&mut region_map_metadata,
63+
); //Third quadrant curve
5264

5365
base.add_region_map("50 V", region_map_metadata); //Use source range to identify region map
5466

@@ -73,7 +85,7 @@ impl Mpsu50Metadata {
7385

7486
while v1.abs() <= voltage_max.abs() {
7587
let v2 = v1 + step;
76-
let i2 = voltage_max / v2.abs();
88+
let i2 = 50.0 / v2.abs();
7789
region_map_metadata.add_region(1, v1, current, v2, i2);
7890
v1 += step;
7991
}
@@ -92,7 +104,7 @@ impl Mpsu50Metadata {
92104

93105
while v1.abs() <= voltage_max.abs() {
94106
let v2 = v1 + step;
95-
let i2 = voltage_max / v2.abs();
107+
let i2 = -50.0 / v2.abs();
96108
region_map_metadata.add_region(1, v2, i2, v1, current);
97109
v1 += step;
98110
}

script-gen-ui/src/app/websocket.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class WebSocketService {
2424
};
2525

2626
this.socket.onmessage = (event) => {
27-
console.log('Message received from server:', event.data);
27+
//console.log('Message received from server:', event.data);
2828
this.messageSubject.next(event.data);
2929
};
3030

0 commit comments

Comments
 (0)