Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RoomView
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOISIL Paul
RoomView
Commits
dcbfcb23
Commit
dcbfcb23
authored
2 years ago
by
FurWaz
Browse files
Options
Downloads
Patches
Plain Diff
Added smart room's zone movements
parent
ff072b5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/app/src/main/java/Structures/RoomInfo.java
+23
-0
23 additions, 0 deletions
Sources/app/src/main/java/Structures/RoomInfo.java
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
+1
-1
1 addition, 1 deletion
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
with
24 additions
and
1 deletion
Sources/app/src/main/java/Structures/RoomInfo.java
+
23
−
0
View file @
dcbfcb23
...
@@ -104,6 +104,29 @@ public class RoomInfo implements Serializable {
...
@@ -104,6 +104,29 @@ public class RoomInfo implements Serializable {
this
.
askForSave
();
this
.
askForSave
();
}
}
public
ZoneInfo
getNearestZone
(
RoomInfo
room
)
{
if
(
this
.
getNbZones
()
==
0
)
return
null
;
ZoneInfo
selectedZone
=
this
.
getZone
(
0
);
int
zone_score
=
0
;
for
(
ZoneInfo
z:
this
.
zones
)
{
int
z_score
=
0
;
for
(
PhotoInfo
ph:
z
.
getPhotos
())
{
for
(
PathView
pv:
ph
.
getPathViews
())
{
PathInfo
p
=
pv
.
getPath
();
if
(
p
==
null
)
continue
;
if
(
p
.
getDestination
().
equals
(
room
))
z_score
++;
}
}
if
(
z_score
>
zone_score
)
{
zone_score
=
z_score
;
selectedZone
=
z
;
}
}
return
selectedZone
;
}
public
void
setBuilding
(
BuildingInfo
building
)
{
this
.
building
=
building
;
}
public
void
setBuilding
(
BuildingInfo
building
)
{
this
.
building
=
building
;
}
public
BuildingInfo
getBuilding
()
{
public
BuildingInfo
getBuilding
()
{
...
...
This diff is collapsed.
Click to expand it.
Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java
+
1
−
1
View file @
dcbfcb23
...
@@ -227,7 +227,7 @@ public class ZoneView extends AppCompatActivity {
...
@@ -227,7 +227,7 @@ public class ZoneView extends AppCompatActivity {
Toast
.
makeText
(
this
,
"Your can't go here.\nThis room doesn't have any zone or photos yet."
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
this
,
"Your can't go here.\nThis room doesn't have any zone or photos yet."
,
Toast
.
LENGTH_SHORT
).
show
();
return
;
return
;
}
}
ZoneInfo
new_zone
=
dest
.
get
Zone
(
0
);
ZoneInfo
new_zone
=
dest
.
get
NearestZone
(
this
.
room
);
old_zone
=
this
.
zone
;
old_zone
=
this
.
zone
;
this
.
room
=
dest
;
this
.
room
=
dest
;
this
.
zone
=
new_zone
;
this
.
zone
=
new_zone
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment