Skip to content

Commit

Permalink
[ML4SE-137] removed ui items for emotion detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mikrise2 committed Oct 11, 2023
1 parent 2ed00af commit 44433e1
Show file tree
Hide file tree
Showing 45 changed files with 1 addition and 147 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
package org.jetbrains.research.tasktracker.config.emoji

import com.intellij.openapi.util.IconLoader
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import javax.swing.Icon

@Serializable
open class Emotion(
val modelPosition: Int,
val name: String,
private val affirmDescriptions: List<String>,
private val adviceDescriptions: List<String> = emptyList()
) {
protected open val iconName: String? = null
protected open val modalWindowIconName: String? = null

@Transient
val icon: Icon? = iconName?.let { IconLoader.getIcon(it, Emotion::class.java) }

@Transient
val modalWindowIcon: Icon? = modalWindowIconName?.let { IconLoader.getIcon(it, Emotion::class.java) }

val randomAffirmDescription
get() = affirmDescriptions.random()

val randomAdviceDescription
get() = adviceDescriptions.random()
}
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package org.jetbrains.research.tasktracker.tracking.webcam

import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import kotlinx.coroutines.runBlocking
import org.jetbrains.research.tasktracker.actions.tracking.NotificationIcons
import org.jetbrains.research.tasktracker.actions.tracking.NotificationWrapper
import org.jetbrains.research.tasktracker.modelInference.EmoPredictor
import org.jetbrains.research.tasktracker.tracking.BaseTracker
import org.jetbrains.research.tasktracker.tracking.logger.WebCamLogger
Expand All @@ -26,36 +23,19 @@ class WebCamTracker(project: Project, private val emoPredictor: EmoPredictor) :
runBlocking {
it.guessEmotionAndLog(emoPredictor, trackerLogger)
}
if (photosMade == PHOTOS_MADE_BEFORE_NOTIFICATION) {
showNotification()
}
}
},
TIME_TO_PHOTO_DELAY,
TIME_TO_PHOTO_DELAY
)
}

private fun showNotification() {
ApplicationManager.getApplication().invokeAndWait {
ApplicationManager.getApplication().runReadAction {
NotificationWrapper(
NotificationIcons.feedbackNotificationIcon,
NotificationWrapper.FEEDBACK_TEXT,
null
).show()
}
}
}

override fun stopTracking() {
timerToMakePhoto.cancel()
}

companion object {
// 5 sec
private const val TIME_TO_PHOTO_DELAY = 5000L

private const val PHOTOS_MADE_BEFORE_NOTIFICATION: Int = (60 * 60 / (TIME_TO_PHOTO_DELAY / 1000)).toInt()
}
}
3 changes: 0 additions & 3 deletions ijPlugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<add-to-group group-id="ToolbarRunGroup" relative-to-action="RunConfiguration" anchor="before"/>
<add-to-group group-id="TouchBarDefault" relative-to-action="RunConfiguration" anchor="before"/>
<add-to-group group-id="RightToolbarSideGroup" anchor="first"/>
<action id="org.jetbrains.research.tasktracker.actions.emoji.EmojiAction"
class="org.jetbrains.research.tasktracker.actions.emoji.EmojiAction" icon="org.jetbrains.research.tasktracker.config.emoji.DefaultEmotion.icon"
/>
</group>
</actions>
</idea-plugin>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit 44433e1

Please sign in to comment.