当前位置: 首页>>代码示例>>Python>>正文


Python Hand.done_with_study_data方法代码示例

本文整理汇总了Python中hand.Hand.done_with_study_data方法的典型用法代码示例。如果您正苦于以下问题:Python Hand.done_with_study_data方法的具体用法?Python Hand.done_with_study_data怎么用?Python Hand.done_with_study_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hand.Hand的用法示例。


在下文中一共展示了Hand.done_with_study_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: WebsocketHandler

# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import done_with_study_data [as 别名]

#.........这里部分代码省略.........

                    if envelope_obj.count() == 0:
                        self.mongo_envelopes.insert({
                            "name": envelope,
                            "gesture": "",
                            "gesture duration": 1000,
                            "allpoints": [],
                            "individual_points": [],
                            "user_id": ObjectId(message[1])
                        })

            envelopes = self.mongo_envelopes.find({"user_id": ObjectId(message[1])})
            envelopes = bson.json_util.dumps(envelopes).replace(",", "§")
            self.write_message("colliders," + gestures + "," + envelopes)


        elif message[0] == "study_start_trial":
            self.mongo_studies.update({"_id": self.current_study_participant}, {
                "$set": {
                    "trials." + message[1] + ".type": message[2],
                    "trials." + message[1] + ".optitrack_data": [],
                    "trials." + message[1] + ".touch_data": [],
                    "trials." + message[1] + ".timestamp": time.time()
                }
            })
            self.data_fetcher.get_data_for_study(self.current_study_participant, message[1])
            self.hand.get_data_for_study(self.current_study_participant, message[1])
            if message[2][-6:] == "-noems":
                self.arduino.study_no_ems = True

            self.start_time = time.time()

        elif message[0] == "study_end_trial":
            fat_var = self.data_fetcher.done_with_study_data()
            self.mongo_studies.update({"_id": self.current_study_participant}, {
                "$set": {
                    "trials." + message[1] + ".time": time.time() - self.start_time,
                    "trials." + message[1] + ".optitrack_data": fat_var
                }
            })
            self.hand.done_with_study_data()
            self.arduino.study_no_ems = False
        elif message[0] == "calibrate":
            self.arduino.calibration(message)
        elif message[0] == "load_study":

            data = self.mongo_studies.find_one({"participant_id": message[1]})
            self.current_study_participant = data["_id"]
            self.mongo_studies.update({"_id": self.current_study_participant}, {"$set": {"name": message[2], "trials": {}}})


            self.write_message("study_data," + json.dumps(data['order']).replace(",", "§"))
        elif message[0] == "save_channels":
            self.mongo_users.update({"_id": ObjectId(message[1])}, {"$set": {
                "channels." + message[2]: {
                    "min": message[3],
                    "max": message[4]
                }
            }})
        elif message[0] == "door":
            if message[1] == "e":
                self.hand.door_mode = "enter"
            elif message[1] == "k":
                self.hand.door_mode = "knock"

        elif message[0] == "load_user":
开发者ID:PedroLopes,项目名称:affordance,代码行数:70,代码来源:websocket_handler.py


注:本文中的hand.Hand.done_with_study_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。