Skip to content

Commit 3b02775

Browse files
committed
Merge branch 'dev'
# Conflicts: # docs/changelog.md # lib/ui/screens/overview/components/printer_card.dart # pubspec.yaml
2 parents 9e4e11b + 1f930ba commit 3b02775

File tree

60 files changed

+3603
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3603
-1012
lines changed

assets/translations/de.json

+26-1
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,32 @@
916916
"hint": "Makros für die Gruppe {} auswählen"
917917
},
918918
"signIn": {
919-
"subtitle": "Die Einrichtung eines Nutzerkontos ist zwar freiwillig, jedoch notwendig, um Käufe, die auf einem anderen Gerät oder einer anderen Plattform getätigt wurden, wiederherzustellen."
919+
"subtitle": "Die Einrichtung eines Nutzerkontos ist zwar freiwillig, jedoch notwendig, um Käufe, die auf einem anderen Gerät oder einer anderen Plattform getätigt wurden, wiederherzustellen.",
920+
"forgot_password": "Passwort vergessen?",
921+
"forgot_password_success": "E-Mail zum Zurücksetzen des Passworts gesendet!",
922+
"hint": {
923+
"sign_in": "Haben Sie noch kein Konto?",
924+
"sign_up": "Haben Sie bereits ein Konto?",
925+
"reset_password": "Geben Sie Ihre E-Mail-Adresse ein, um einen Link zum Zurücksetzen des Passworts zu erhalten."
926+
},
927+
"action": {
928+
"sign_in": "Anmelden",
929+
"sign_up": "Registrieren",
930+
"reset_password": "Passwort zurücksetzen"
931+
},
932+
"email": {
933+
"label": "E-Mail",
934+
"hint": "Ihre E-Mail-Adresse"
935+
},
936+
"password": {
937+
"label": "Passwort",
938+
"hint": "Ihr Passwort"
939+
},
940+
"confirm_password": {
941+
"label": "Passwort bestätigen",
942+
"hint": "Bestätigen Sie Ihr Passwort",
943+
"error": "Passwörter stimmen nicht überein!"
944+
}
920945
},
921946
"profile": {
922947
"title": "Sie sind eingeloggt.",

assets/translations/en.json

+26-1
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,32 @@
916916
"hint": "Select macros for group {}"
917917
},
918918
"signIn": {
919-
"subtitle": "Although creating an account is optional, it is necessary to do so in order to restore purchases made on another device or platform."
919+
"subtitle": "Although creating an account is optional, it is necessary to do so in order to restore purchases made on another device or platform.",
920+
"forgot_password": "Forgot Password?",
921+
"forgot_password_success": "Password reset email sent!",
922+
"hint": {
923+
"sign_in": "Dont have an account yet?",
924+
"sign_up": "Already have an account?",
925+
"reset_password": "Provide your email address to receive a password reset link."
926+
},
927+
"action": {
928+
"sign_in": "Sign In",
929+
"sign_up": "Sign Up",
930+
"reset_password": "Reset Password"
931+
},
932+
"email": {
933+
"label": "Email",
934+
"hint": "Your email address"
935+
},
936+
"password": {
937+
"label": "Password",
938+
"hint": "Your password"
939+
},
940+
"confirm_password": {
941+
"label": "Confirm Password",
942+
"hint": "Confirm your password",
943+
"error": "Passwords do not match!"
944+
}
920945
},
921946
"profile": {
922947
"title": "You are signed in.",

common/lib/data/dto/config/config_file_object_identifiers_enum.dart

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ enum ConfigFileObjectIdentifiers {
2626
filament_switch_sensor(null),
2727
filament_motion_sensor(null),
2828
screws_tilt_adjust(null),
29+
z_thermal_adjust(null),
2930
;
3031

3132
/// IF it is possible to check a object with a == (null) or startsWith (true)

common/lib/data/dto/machine/printer.dart

+22
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:common/data/dto/machine/bed_mesh/bed_mesh.dart';
77
import 'package:common/data/dto/machine/filament_sensors/filament_sensor.dart';
88
import 'package:common/data/dto/machine/print_stats.dart';
99
import 'package:common/data/dto/machine/screws_tilt_adjust/screws_tilt_adjust.dart';
10+
import 'package:common/data/dto/machine/z_thermal_adjust.dart';
1011
import 'package:common/exceptions/mobileraker_exception.dart';
1112
import 'package:freezed_annotation/freezed_annotation.dart';
1213

@@ -35,6 +36,23 @@ part 'printer.freezed.dart';
3536
class PrinterBuilder {
3637
PrinterBuilder();
3738

39+
factory PrinterBuilder.preview() {
40+
var toolhead = const Toolhead();
41+
var gCodeMove = const GCodeMove();
42+
var motionReport = const MotionReport();
43+
var print = const PrintStats();
44+
var configFile = ConfigFile();
45+
var virtualSdCard = const VirtualSdCard();
46+
47+
return PrinterBuilder()
48+
..toolhead = toolhead
49+
..gCodeMove = gCodeMove
50+
..motionReport = motionReport
51+
..print = print
52+
..configFile = configFile
53+
..virtualSdCard = virtualSdCard;
54+
}
55+
3856
PrinterBuilder.fromPrinter(Printer printer)
3957
: toolhead = printer.toolhead,
4058
extruders = printer.extruders,
@@ -60,6 +78,7 @@ class PrinterBuilder {
6078
leds = printer.leds,
6179
genericHeaters = printer.genericHeaters,
6280
filamentSensors = printer.filamentSensors,
81+
zThermalAdjust = printer.zThermalAdjust,
6382
currentFile = printer.currentFile;
6483

6584
Toolhead? toolhead;
@@ -79,6 +98,7 @@ class PrinterBuilder {
7998
GCodeFile? currentFile;
8099
FirmwareRetraction? firmwareRetraction;
81100
BedMesh? bedMesh;
101+
ZThermalAdjust? zThermalAdjust;
82102
Map<String, NamedFan> fans = {};
83103
Map<String, TemperatureSensor> temperatureSensors = {};
84104
Map<String, OutputPin> outputPins = {};
@@ -135,6 +155,7 @@ class PrinterBuilder {
135155
leds: Map.unmodifiable(leds),
136156
genericHeaters: Map.unmodifiable(genericHeaters),
137157
filamentSensors: Map.unmodifiable(filamentSensors),
158+
zThermalAdjust: zThermalAdjust,
138159
);
139160
return printer;
140161
}
@@ -162,6 +183,7 @@ class Printer with _$Printer {
162183
FirmwareRetraction? firmwareRetraction,
163184
BedMesh? bedMesh,
164185
GCodeFile? currentFile,
186+
ZThermalAdjust? zThermalAdjust,
165187
@Default({}) Map<String, NamedFan> fans,
166188
@Default({}) Map<String, TemperatureSensor> temperatureSensors,
167189
@Default({}) Map<String, OutputPin> outputPins,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2023-2024. Patrick Schmidt.
3+
* All rights reserved.
4+
*/
5+
6+
import 'package:common/data/dto/machine/sensor_mixin.dart';
7+
import 'package:freezed_annotation/freezed_annotation.dart';
8+
9+
import '../../../util/json_util.dart';
10+
11+
part 'z_thermal_adjust.freezed.dart';
12+
part 'z_thermal_adjust.g.dart';
13+
14+
// z_thermal_adjust
15+
// {
16+
// 'temperature': self.smoothed_temp,
17+
// 'measured_min_temp': round(self.measured_min, 2),
18+
// 'measured_max_temp': round(self.measured_max, 2),
19+
// 'current_z_adjust': self.z_adjust_mm,
20+
// 'z_adjust_ref_temperature': self.ref_temperature,
21+
// 'enabled': self.adjust_enable
22+
// }
23+
24+
@freezed
25+
class ZThermalAdjust with _$ZThermalAdjust, SensorMixin {
26+
const ZThermalAdjust._();
27+
28+
@JsonSerializable(fieldRename: FieldRename.snake)
29+
const factory ZThermalAdjust({
30+
@Default(false) bool enabled,
31+
@Default(0) double temperature,
32+
@Default(0) double measuredMinTemp,
33+
@Default(0) double measuredMaxTemp,
34+
@Default(0) double currentZAdjust,
35+
@Default(0) double zAdjustRefTemperature,
36+
@JsonKey(name: 'temperatures') List<double>? temperatureHistory,
37+
required DateTime lastHistory,
38+
}) = _ZThermalAdjust;
39+
40+
factory ZThermalAdjust.fromJson(Map<String, dynamic> json) => _$ZThermalAdjustFromJson(json);
41+
42+
factory ZThermalAdjust.partialUpdate(ZThermalAdjust? current, Map<String, dynamic> partialJson) {
43+
if (current == null) return ZThermalAdjust.fromJson(partialJson);
44+
45+
var mergedJson = {...current.toJson(), ...partialJson};
46+
47+
// Ill just put the tempCache here because I am lazy.. kinda sucks but who cares
48+
// Update temp cache for graphs!
49+
DateTime now = DateTime.now();
50+
51+
if (now.difference(current.lastHistory).inSeconds >= 1) {
52+
mergedJson = {
53+
...mergedJson,
54+
'temperatures': updateHistoryListInJson(mergedJson, 'temperatures', 'temperature'),
55+
'last_history': now.toIso8601String()
56+
};
57+
}
58+
59+
return ZThermalAdjust.fromJson(mergedJson);
60+
}
61+
62+
@override
63+
String get name => 'z_thermal_adjust';
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright (c) 2023-2024. Patrick Schmidt.
3+
* All rights reserved.
4+
*/
5+
6+
import 'package:common/data/model/hive/dashboard_component_type.dart';
7+
import 'package:hive_flutter/hive_flutter.dart';
8+
import 'package:uuid/uuid.dart';
9+
10+
part 'dashboard_component.g.dart';
11+
12+
@HiveType(typeId: 10)
13+
class DashboardComponent extends HiveObject {
14+
DashboardComponent({
15+
required this.type,
16+
this.showWhilePrinting = true,
17+
this.showBeforePrinterReady = false,
18+
});
19+
20+
DashboardComponent._({
21+
required this.uuid,
22+
required this.type,
23+
this.showWhilePrinting = true,
24+
this.showBeforePrinterReady = false,
25+
});
26+
27+
@HiveField(0)
28+
String uuid = const Uuid().v4();
29+
30+
@HiveField(1)
31+
DashboardComponentType type;
32+
33+
@HiveField(2)
34+
bool showWhilePrinting;
35+
36+
@HiveField(3)
37+
bool showBeforePrinterReady;
38+
39+
DashboardComponent copyWith({
40+
DashboardComponentType? type,
41+
bool? showWhilePrinting,
42+
bool? showBeforePrinterReady,
43+
}) {
44+
return DashboardComponent._(
45+
uuid: uuid,
46+
type: type ?? this.type,
47+
showWhilePrinting: showWhilePrinting ?? this.showWhilePrinting,
48+
showBeforePrinterReady: showBeforePrinterReady ?? this.showBeforePrinterReady,
49+
);
50+
}
51+
52+
@override
53+
bool operator ==(Object other) =>
54+
identical(this, other) ||
55+
other is DashboardComponent &&
56+
runtimeType == other.runtimeType &&
57+
(identical(uuid, other.uuid) || uuid == other.uuid) &&
58+
(identical(type, other.type) || type == other.type) &&
59+
(identical(showWhilePrinting, other.showWhilePrinting) || showWhilePrinting == other.showWhilePrinting) &&
60+
(identical(showBeforePrinterReady, other.showBeforePrinterReady) ||
61+
showBeforePrinterReady == other.showBeforePrinterReady);
62+
63+
// const DeepCollectionEquality().equals(components, other.components);
64+
65+
@override
66+
int get hashCode => Object.hash(
67+
uuid,
68+
type,
69+
showWhilePrinting,
70+
showBeforePrinterReady,
71+
);
72+
73+
@override
74+
String toString() {
75+
return 'DashboardComponent{uuid: $uuid, type: $type, showWhilePrinting: $showWhilePrinting}';
76+
}
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2023-2024. Patrick Schmidt.
3+
* All rights reserved.
4+
*/
5+
6+
import 'package:hive_flutter/hive_flutter.dart';
7+
8+
part 'dashboard_component_type.g.dart';
9+
10+
@HiveType(typeId: 11)
11+
enum DashboardComponentType {
12+
@HiveField(0)
13+
machineStatus,
14+
@HiveField(1)
15+
temperatureSensorPreset,
16+
@HiveField(2)
17+
webcam,
18+
@HiveField(3)
19+
controlXYZ,
20+
@HiveField(4)
21+
zOffset,
22+
@HiveField(5)
23+
spoolman,
24+
@HiveField(6)
25+
macroGroup,
26+
@HiveField(7)
27+
controlExtruder,
28+
@HiveField(8)
29+
fans,
30+
@HiveField(9)
31+
pins,
32+
@HiveField(10)
33+
powerApi,
34+
@HiveField(11)
35+
groupedSliders,
36+
@HiveField(12)
37+
multipliers,
38+
@HiveField(13)
39+
limits,
40+
@HiveField(14)
41+
firmwareRetraction,
42+
@HiveField(15)
43+
bedMesh;
44+
}

0 commit comments

Comments
 (0)