Erweiterungen
This commit is contained in:
1 parent
4598618b7d
commit
34d4420855
3 files changed
+20
-61
No files matched your search
@@ -358,12 +358,19 @@ class _TaskListPageState extends State<TaskListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isTaskActive(int index) {
|
bool isTaskActive(int index) {
|
||||||
for (int i = 0; i < index; i++) {
|
var currentTaskInfo = _taskList[index];
|
||||||
var taskInfo = _taskList[i];
|
|
||||||
|
|
||||||
if (!taskInfo.completed) return false;
|
if (currentTaskInfo.completed && !currentTaskInfo.task.reenter!) return false;
|
||||||
|
|
||||||
|
for (var taskInfo in _taskList)
|
||||||
|
{
|
||||||
|
if (taskInfo == currentTaskInfo) break;
|
||||||
|
|
||||||
|
if (!taskInfo.task.opt! && !taskInfo.completed) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentTaskInfo.task.reenter!) return true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,22 +392,6 @@ class _TaskListPageState extends State<TaskListPage> {
|
|||||||
MqttCore.instance.publishPayloadMessage("job", finTaskMessage.toJson());
|
MqttCore.instance.publishPayloadMessage("job", finTaskMessage.toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*_sendTrackStationMessage(TaskInfo taskInfo)
|
|
||||||
{
|
|
||||||
var trackStationMessage = TrackStationMessage();
|
|
||||||
trackStationMessage.sid = taskInfo.task.sId;
|
|
||||||
trackStationMessage.time = DateTime.now().toIso8601String();
|
|
||||||
|
|
||||||
var position = MyApp.currentPosition;
|
|
||||||
if (position != null) {
|
|
||||||
trackStationMessage.pos = FinTaskPos();
|
|
||||||
trackStationMessage.pos!.lat = position.latitude;
|
|
||||||
trackStationMessage.pos!.long = position.latitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
MqttCore.instance.publishPayloadMessage("", trackStationMessage.toJson());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
_sendFinTourMessage() async {
|
_sendFinTourMessage() async {
|
||||||
var finTourMessage = FinTourMessage();
|
var finTourMessage = FinTourMessage();
|
||||||
finTourMessage.finTour = FinTour();
|
finTourMessage.finTour = FinTour();
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ class TourTask {
|
|||||||
late int sId;
|
late int sId;
|
||||||
late int type;
|
late int type;
|
||||||
late String topic;
|
late String topic;
|
||||||
late bool? opt;
|
late bool opt = true;
|
||||||
late bool? reenter;
|
late bool reenter = false;
|
||||||
late int? min;
|
late int? min;
|
||||||
late int? max;
|
late int? max;
|
||||||
@JsonKey(name: 'max_len')
|
@JsonKey(name: 'max_len')
|
||||||
|
|||||||
@@ -170,8 +170,8 @@ TourTask _tourTaskDeserialize(
|
|||||||
object.max = reader.readLongOrNull(offsets[1]);
|
object.max = reader.readLongOrNull(offsets[1]);
|
||||||
object.maxLen = reader.readLongOrNull(offsets[2]);
|
object.maxLen = reader.readLongOrNull(offsets[2]);
|
||||||
object.min = reader.readLongOrNull(offsets[3]);
|
object.min = reader.readLongOrNull(offsets[3]);
|
||||||
object.opt = reader.readBoolOrNull(offsets[4]);
|
object.opt = reader.readBool(offsets[4]);
|
||||||
object.reenter = reader.readBoolOrNull(offsets[5]);
|
object.reenter = reader.readBool(offsets[5]);
|
||||||
object.rt = reader.readBoolOrNull(offsets[6]);
|
object.rt = reader.readBoolOrNull(offsets[6]);
|
||||||
object.sId = reader.readLong(offsets[7]);
|
object.sId = reader.readLong(offsets[7]);
|
||||||
object.taskArrival = reader.readLongOrNull(offsets[8]);
|
object.taskArrival = reader.readLongOrNull(offsets[8]);
|
||||||
@@ -204,9 +204,9 @@ P _tourTaskDeserializeProp<P>(
|
|||||||
case 3:
|
case 3:
|
||||||
return (reader.readLongOrNull(offset)) as P;
|
return (reader.readLongOrNull(offset)) as P;
|
||||||
case 4:
|
case 4:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
return (reader.readBool(offset)) as P;
|
||||||
case 5:
|
case 5:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
return (reader.readBool(offset)) as P;
|
||||||
case 6:
|
case 6:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
return (reader.readBoolOrNull(offset)) as P;
|
||||||
case 7:
|
case 7:
|
||||||
@@ -538,24 +538,8 @@ extension TourTaskQueryFilter
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optIsNull() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
|
||||||
property: r'opt',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optIsNotNull() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
|
||||||
property: r'opt',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optEqualTo(
|
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> optEqualTo(
|
||||||
bool? value) {
|
bool value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
property: r'opt',
|
property: r'opt',
|
||||||
@@ -564,24 +548,8 @@ extension TourTaskQueryFilter
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterIsNull() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
|
||||||
property: r'reenter',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterIsNotNull() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
|
||||||
property: r'reenter',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterEqualTo(
|
QueryBuilder<TourTask, TourTask, QAfterFilterCondition> reenterEqualTo(
|
||||||
bool? value) {
|
bool value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
property: r'reenter',
|
property: r'reenter',
|
||||||
@@ -1550,8 +1518,8 @@ TourTask _$TourTaskFromJson(Map<String, dynamic> json) => TourTask()
|
|||||||
..sId = json['s_id'] as int
|
..sId = json['s_id'] as int
|
||||||
..type = json['type'] as int
|
..type = json['type'] as int
|
||||||
..topic = json['topic'] as String
|
..topic = json['topic'] as String
|
||||||
..opt = json['opt'] as bool?
|
..opt = json['opt'] as bool
|
||||||
..reenter = json['reenter'] as bool?
|
..reenter = json['reenter'] as bool
|
||||||
..min = json['min'] as int?
|
..min = json['min'] as int?
|
||||||
..max = json['max'] as int?
|
..max = json['max'] as int?
|
||||||
..maxLen = json['max_len'] as int?
|
..maxLen = json['max_len'] as int?
|
||||||
|
|||||||
Reference in new issue
Block a user