# HG changeset patch
# User Jeandet Alexis
# Date 2014-03-05 10:37:48
# Node ID 27ed47eb6044d7760ae16774f8eee21fc56fe718
# Parent c68f11fff9445d881f3b969ec8428800d711eeff
Added disconnection auto-detection to the spacewire plugin.
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,3 +1,7 @@
syntax: glob
*.pro.user
*.o
+moc_*
+*.so*
+ui_*.h
+Makefile
diff --git a/APBUARTPLUGIN/APBUARTPLUGIN.cpp b/APBUARTPLUGIN/APBUARTPLUGIN.cpp
--- a/APBUARTPLUGIN/APBUARTPLUGIN.cpp
+++ b/APBUARTPLUGIN/APBUARTPLUGIN.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/APBUARTPLUGIN.h b/APBUARTPLUGIN/APBUARTPLUGIN.h
--- a/APBUARTPLUGIN/APBUARTPLUGIN.h
+++ b/APBUARTPLUGIN/APBUARTPLUGIN.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartcfg.cpp b/APBUARTPLUGIN/apbuartcfg.cpp
--- a/APBUARTPLUGIN/apbuartcfg.cpp
+++ b/APBUARTPLUGIN/apbuartcfg.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartcfg.h b/APBUARTPLUGIN/apbuartcfg.h
--- a/APBUARTPLUGIN/apbuartcfg.h
+++ b/APBUARTPLUGIN/apbuartcfg.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartpluginui.cpp b/APBUARTPLUGIN/apbuartpluginui.cpp
--- a/APBUARTPLUGIN/apbuartpluginui.cpp
+++ b/APBUARTPLUGIN/apbuartpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartpluginui.h b/APBUARTPLUGIN/apbuartpluginui.h
--- a/APBUARTPLUGIN/apbuartpluginui.h
+++ b/APBUARTPLUGIN/apbuartpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartterminal.cpp b/APBUARTPLUGIN/apbuartterminal.cpp
--- a/APBUARTPLUGIN/apbuartterminal.cpp
+++ b/APBUARTPLUGIN/apbuartterminal.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/APBUARTPLUGIN/apbuartterminal.h b/APBUARTPLUGIN/apbuartterminal.h
--- a/APBUARTPLUGIN/apbuartterminal.h
+++ b/APBUARTPLUGIN/apbuartterminal.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ahbuartplugin/ahbuartplugin.cpp b/ahbuartplugin/ahbuartplugin.cpp
--- a/ahbuartplugin/ahbuartplugin.cpp
+++ b/ahbuartplugin/ahbuartplugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ahbuartplugin/ahbuartplugin.h b/ahbuartplugin/ahbuartplugin.h
--- a/ahbuartplugin/ahbuartplugin.h
+++ b/ahbuartplugin/ahbuartplugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ahbuartplugin/ahbuartpluginui.cpp b/ahbuartplugin/ahbuartpluginui.cpp
--- a/ahbuartplugin/ahbuartpluginui.cpp
+++ b/ahbuartplugin/ahbuartpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ahbuartplugin/ahbuartpluginui.h b/ahbuartplugin/ahbuartpluginui.h
--- a/ahbuartplugin/ahbuartpluginui.h
+++ b/ahbuartplugin/ahbuartpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ahbuartplugin/ahbuartpywrapper.cpp b/ahbuartplugin/ahbuartpywrapper.cpp
--- a/ahbuartplugin/ahbuartpywrapper.cpp
+++ b/ahbuartplugin/ahbuartpywrapper.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/AHB/ahbdevicelist.cpp b/ambaplugin/AHB/ahbdevicelist.cpp
--- a/ambaplugin/AHB/ahbdevicelist.cpp
+++ b/ambaplugin/AHB/ahbdevicelist.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/AHB/ahbdevicelist.h b/ambaplugin/AHB/ahbdevicelist.h
--- a/ambaplugin/AHB/ahbdevicelist.h
+++ b/ambaplugin/AHB/ahbdevicelist.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/AHB/ahbpluginui.cpp b/ambaplugin/AHB/ahbpluginui.cpp
--- a/ambaplugin/AHB/ahbpluginui.cpp
+++ b/ambaplugin/AHB/ahbpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/AHB/ahbpluginui.h b/ambaplugin/AHB/ahbpluginui.h
--- a/ambaplugin/AHB/ahbpluginui.h
+++ b/ambaplugin/AHB/ahbpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/APB/apbdevicelist.cpp b/ambaplugin/APB/apbdevicelist.cpp
--- a/ambaplugin/APB/apbdevicelist.cpp
+++ b/ambaplugin/APB/apbdevicelist.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/APB/apbdevicelist.h b/ambaplugin/APB/apbdevicelist.h
--- a/ambaplugin/APB/apbdevicelist.h
+++ b/ambaplugin/APB/apbdevicelist.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/APB/apbpluginui.cpp b/ambaplugin/APB/apbpluginui.cpp
--- a/ambaplugin/APB/apbpluginui.cpp
+++ b/ambaplugin/APB/apbpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/APB/apbpluginui.h b/ambaplugin/APB/apbpluginui.h
--- a/ambaplugin/APB/apbpluginui.h
+++ b/ambaplugin/APB/apbpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/ambaplugin.cpp b/ambaplugin/ambaplugin.cpp
--- a/ambaplugin/ambaplugin.cpp
+++ b/ambaplugin/ambaplugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/ambaplugin.h b/ambaplugin/ambaplugin.h
--- a/ambaplugin/ambaplugin.h
+++ b/ambaplugin/ambaplugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/ambapluginui.cpp b/ambaplugin/ambapluginui.cpp
--- a/ambaplugin/ambapluginui.cpp
+++ b/ambaplugin/ambapluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/ambaplugin/ambapluginui.h b/ambaplugin/ambapluginui.h
--- a/ambaplugin/ambapluginui.h
+++ b/ambaplugin/ambapluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/dsu3plugin/dsu3plugin.cpp b/dsu3plugin/dsu3plugin.cpp
--- a/dsu3plugin/dsu3plugin.cpp
+++ b/dsu3plugin/dsu3plugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/dsu3plugin/dsu3plugin.h b/dsu3plugin/dsu3plugin.h
--- a/dsu3plugin/dsu3plugin.h
+++ b/dsu3plugin/dsu3plugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/dsu3plugin/dsu3pluginui.cpp b/dsu3plugin/dsu3pluginui.cpp
--- a/dsu3plugin/dsu3pluginui.cpp
+++ b/dsu3plugin/dsu3pluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2013, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/dsu3plugin/dsu3pluginui.h b/dsu3plugin/dsu3pluginui.h
--- a/dsu3plugin/dsu3pluginui.h
+++ b/dsu3plugin/dsu3pluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2012, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2012, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwplugin.cpp b/genericrwplugin/genericrwplugin.cpp
--- a/genericrwplugin/genericrwplugin.cpp
+++ b/genericrwplugin/genericrwplugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwplugin.h b/genericrwplugin/genericrwplugin.h
--- a/genericrwplugin/genericrwplugin.h
+++ b/genericrwplugin/genericrwplugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwpluginpywrapper.cpp b/genericrwplugin/genericrwpluginpywrapper.cpp
--- a/genericrwplugin/genericrwpluginpywrapper.cpp
+++ b/genericrwplugin/genericrwpluginpywrapper.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwpluginpywrapper.h b/genericrwplugin/genericrwpluginpywrapper.h
--- a/genericrwplugin/genericrwpluginpywrapper.h
+++ b/genericrwplugin/genericrwpluginpywrapper.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwpluginui.cpp b/genericrwplugin/genericrwpluginui.cpp
--- a/genericrwplugin/genericrwpluginui.cpp
+++ b/genericrwplugin/genericrwpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/genericrwpluginui.h b/genericrwplugin/genericrwpluginui.h
--- a/genericrwplugin/genericrwpluginui.h
+++ b/genericrwplugin/genericrwpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/memeditor.cpp b/genericrwplugin/memeditor.cpp
--- a/genericrwplugin/memeditor.cpp
+++ b/genericrwplugin/memeditor.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/genericrwplugin/memeditor.h b/genericrwplugin/memeditor.h
--- a/genericrwplugin/memeditor.h
+++ b/genericrwplugin/memeditor.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/memctrlrplugin/memctrlrplugin.cpp b/memctrlrplugin/memctrlrplugin.cpp
--- a/memctrlrplugin/memctrlrplugin.cpp
+++ b/memctrlrplugin/memctrlrplugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/memctrlrplugin/memctrlrplugin.h b/memctrlrplugin/memctrlrplugin.h
--- a/memctrlrplugin/memctrlrplugin.h
+++ b/memctrlrplugin/memctrlrplugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/memctrlrplugin/memctrlrpluginui.cpp b/memctrlrplugin/memctrlrpluginui.cpp
--- a/memctrlrplugin/memctrlrpluginui.cpp
+++ b/memctrlrplugin/memctrlrpluginui.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/memctrlrplugin/memctrlrpluginui.h b/memctrlrplugin/memctrlrpluginui.h
--- a/memctrlrplugin/memctrlrpluginui.h
+++ b/memctrlrplugin/memctrlrpluginui.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2011, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/spwplugin/abstractspwbridge.cpp b/spwplugin/abstractspwbridge.cpp
--- a/spwplugin/abstractspwbridge.cpp
+++ b/spwplugin/abstractspwbridge.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/spwplugin/abstractspwbridge.h b/spwplugin/abstractspwbridge.h
--- a/spwplugin/abstractspwbridge.h
+++ b/spwplugin/abstractspwbridge.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -40,6 +40,8 @@ public slots:
virtual unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0)=0;
virtual unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0)=0;
virtual int pushRMAPPacket(char* packet,int size)=0;
+signals:
+ void setConnected(bool connected);
protected:
socexplorerplugin* plugin;
QWidget* p_GUI;
diff --git a/spwplugin/spw.h b/spwplugin/spw.h
--- a/spwplugin/spw.h
+++ b/spwplugin/spw.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
diff --git a/spwplugin/spwplugin.cpp b/spwplugin/spwplugin.cpp
--- a/spwplugin/spwplugin.cpp
+++ b/spwplugin/spwplugin.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@ void spwplugin::bridgeSelectionChanged(c
if(this->bridge!=NULL)
{
this->mainLayout->removeWidget(this->bridge->getGUI());
+ this->disconnect(this,SLOT(setConnected(bool)));
delete this->bridge;
this->bridge= NULL;
}
@@ -75,14 +76,22 @@ void spwplugin::bridgeSelectionChanged(c
if(this->bridge!=NULL)
{
this->mainLayout->removeWidget(this->bridge->getGUI());
+ this->disconnect(this,SLOT(setConnected(bool)));
delete this->bridge;
}
this->bridge = new stardundeeSPW_USB(this);
this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2);
+ connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool)));
}
}
+void spwplugin::setConnected(bool connected)
+{
+ this->Connected = connected;
+ emit activateSig(connected);
+}
+
unsigned int spwplugin::Write(unsigned int *Value,unsigned int count, unsigned int address)
diff --git a/spwplugin/spwplugin.h b/spwplugin/spwplugin.h
--- a/spwplugin/spwplugin.h
+++ b/spwplugin/spwplugin.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -54,7 +54,8 @@ public slots:
unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
- void bridgeSelectionChanged( const QString & text );
+ void bridgeSelectionChanged( const QString & text );
+ void setConnected(bool connected);
signals:
diff --git a/spwplugin/stardundeeGUI.ui b/spwplugin/stardundeeGUI.ui
--- a/spwplugin/stardundeeGUI.ui
+++ b/spwplugin/stardundeeGUI.ui
@@ -6,8 +6,8 @@
0
0
- 614
- 152
+ 645
+ 231
@@ -80,7 +80,7 @@
-
-
+
32
@@ -90,8 +90,48 @@
+ -
+
+
+ RMAP Target address
+
+
+
-
-
+
+
+
+
+
+ 254
+
+
+ 3
+
+
+
+ -
+
+
+ RMAP Target key
+
+
+
+ -
+
+
+
+
+
+ 2
+
+
+ 3
+
+
+
+ -
+
Connect
diff --git a/spwplugin/stardundeegui.cpp b/spwplugin/stardundeegui.cpp
--- a/spwplugin/stardundeegui.cpp
+++ b/spwplugin/stardundeegui.cpp
@@ -1,3 +1,24 @@
+/*------------------------------------------------------------------------------
+-- This file is a part of the SocExplorer Software
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------*/
+/*-- Author : Alexis Jeandet
+-- Mail : alexis.jeandet@member.fsf.org
+----------------------------------------------------------------------------*/
#include "stardundeegui.h"
#include "ui_stardundeeGUI.h"
@@ -6,4 +27,72 @@ StarDundeeGUI::StarDundeeGUI(QWidget *pa
QWidget(parent),ui(new Ui::StarDundeeUI)
{
this->ui->setupUi(this);
+ connect(this->ui->selectBrickCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(brickSelectionChanged(int)));
+ connect(this->ui->selectLinkCmbx,SIGNAL(currentIndexChanged(int)),this,SIGNAL(linkNumberSelectionChanged(int)));
+ connect(this->ui->setLinkSpeedCmbx,SIGNAL(currentIndexChanged(QString)),this,SIGNAL(linkSpeedSelectionChanged(QString)));
+ connect(this->ui->destKeyLineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(destinationKeyChanged(QString)));
+ connect(this->ui->RMAPAddresslineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapAddressChanged(QString)));
+ connect(this->ui->RMAPKeylineEdit,SIGNAL(textChanged(QString)),this,SIGNAL(rmapKeyChanged(QString)));
+ connect(this->ui->connectQpb,SIGNAL(clicked()),this,SIGNAL(connectClicked()));
+
}
+
+int StarDundeeGUI::getBrickSelection()
+{
+ return ui->selectBrickCmbx->currentIndex();
+}
+
+int StarDundeeGUI::getLinkNumberSelection()
+{
+ return ui->selectLinkCmbx->currentIndex();
+}
+
+QString StarDundeeGUI::getLinkSpeedSelection()
+{
+ return ui->setLinkSpeedCmbx->currentText();
+}
+
+QString StarDundeeGUI::getDestinationKey()
+{
+ return ui->destKeyLineEdit->text();
+}
+
+QString StarDundeeGUI::getRmapAddress()
+{
+ return ui->RMAPAddresslineEdit->text();
+}
+
+QString StarDundeeGUI::getRmapKey()
+{
+ return ui->RMAPKeylineEdit->text();
+}
+
+
+
+void StarDundeeGUI::lock(bool lock)
+{
+ this->ui->selectBrickCmbx->setDisabled(lock);
+ this->ui->selectLinkCmbx->setDisabled(lock);
+ this->ui->setLinkSpeedCmbx->setDisabled(lock);
+ this->ui->destKeyLineEdit->setDisabled(lock);
+ this->ui->RMAPAddresslineEdit->setDisabled(lock);
+ this->ui->RMAPKeylineEdit->setDisabled(lock);
+ if(lock)
+ this->ui->connectQpb->setText("Disconnect");
+ else
+ this->ui->connectQpb->setText("Connect");
+}
+
+void StarDundeeGUI::updateAvailableBrickCount(int count)
+{
+ this->ui->selectBrickCmbx->clear();
+ this->ui->selectBrickCmbx->addItem("none");
+ for(int i =0;i<32;i++)
+ {
+ if((count&1)==1)
+ {
+ this->ui->selectBrickCmbx->addItem("STAR-Dundee USB brick "+QString::number(i));
+ }
+ count>>=1;
+ }
+}
diff --git a/spwplugin/stardundeegui.h b/spwplugin/stardundeegui.h
--- a/spwplugin/stardundeegui.h
+++ b/spwplugin/stardundeegui.h
@@ -1,3 +1,24 @@
+/*------------------------------------------------------------------------------
+-- This file is a part of the SocExplorer Software
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------*/
+/*-- Author : Alexis Jeandet
+-- Mail : alexis.jeandet@member.fsf.org
+----------------------------------------------------------------------------*/
#ifndef STARDUNDEEGUI_H
#define STARDUNDEEGUI_H
@@ -12,10 +33,23 @@ class StarDundeeGUI : public QWidget
Q_OBJECT
public:
explicit StarDundeeGUI(QWidget *parent = 0);
-
+ int getBrickSelection();
+ int getLinkNumberSelection();
+ QString getLinkSpeedSelection();
+ QString getDestinationKey();
+ QString getRmapAddress();
+ QString getRmapKey();
signals:
-
+ void brickSelectionChanged(int brickIndex);
+ void linkNumberSelectionChanged(int linkIndex);
+ void linkSpeedSelectionChanged(const QString & linkSpeed);
+ void destinationKeyChanged(const QString & destKey);
+ void rmapAddressChanged(const QString & address);
+ void rmapKeyChanged(const QString & key);
+ void connectClicked();
public slots:
+ void lock(bool lock);
+ void updateAvailableBrickCount(int count);
private:
Ui::StarDundeeUI *ui;
diff --git a/spwplugin/stardundeespw_usb.cpp b/spwplugin/stardundeespw_usb.cpp
--- a/spwplugin/stardundeespw_usb.cpp
+++ b/spwplugin/stardundeespw_usb.cpp
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -45,14 +45,16 @@ void stardundeeSPW_USB::toggleBridgeConn
{
if(this->disconnectBridge())
{
- this->connectBridgeButton->setText("Connect");
+ ((StarDundeeGUI*)this->p_GUI)->lock(false);
+ emit setConnected(false);
}
}
else
{
if(this->connectBridge())
{
- this->connectBridgeButton->setText("Disconnect");
+ ((StarDundeeGUI*)this->p_GUI)->lock(true);
+ emit setConnected(true);
}
}
}
@@ -75,10 +77,10 @@ int stardundeeSPW_USB::pushRMAPPacket(ch
unsigned int stardundeeSPW_USB::Write(unsigned int *Value, unsigned int count, unsigned int address)
{
char writeBuffer[RMAP_WRITE_PACKET_MIN_SZ((RMAP_MAX_XFER_SIZE*4))+1];
- writeBuffer[0]=1;//Link number
+ writeBuffer[0]=this->manager->linkNumber;//Link number
int transactionID = 0;
int written=0;
- SocExplorerEngine::message(this->plugin,"Enter Write function");
+ SocExplorerEngine::message(this->plugin,"Enter Write function",2);
QProgressBar* progress=NULL;
if(count>RMAP_MAX_XFER_SIZE)
progress= SocExplorerEngine::getProgressBar("Writing on SPW @0x"+QString::number(address,16)+" %v of "+QString::number(count)+" words ",count);
@@ -92,7 +94,7 @@ unsigned int stardundeeSPW_USB::Write(un
writeBuffer[RMAP_WRITE_HEADER_MIN_SZ+(i*4)+3] = (char)(((unsigned int)Value[i+written]>>8)&0xFF);
writeBuffer[RMAP_WRITE_HEADER_MIN_SZ+(i*4)+4] = (char)(((unsigned int)Value[i+written])&0xFF);
}
- RMAP_build_tx_request_header(254,2,1,transactionID,address+(written*4),RMAP_MAX_XFER_SIZE*4,writeBuffer+1);
+ RMAP_build_tx_request_header(this->manager->rmapAddress,this->manager->rmapKey,1,transactionID,address+(written*4),RMAP_MAX_XFER_SIZE*4,writeBuffer+1);
manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(RMAP_MAX_XFER_SIZE*4)+1);
written+=RMAP_MAX_XFER_SIZE;
count-=RMAP_MAX_XFER_SIZE;
@@ -108,7 +110,7 @@ unsigned int stardundeeSPW_USB::Write(un
writeBuffer[RMAP_WRITE_HEADER_MIN_SZ+(i*4)+3] = (char)(((unsigned int)Value[i+written]>>8)&0xFF);
writeBuffer[RMAP_WRITE_HEADER_MIN_SZ+(i*4)+4] = (char)(((unsigned int)Value[i+written])&0xFF);
}
- RMAP_build_tx_request_header(254,2,1,transactionID,address+(written*4),count*4,writeBuffer+1);
+ RMAP_build_tx_request_header(this->manager->rmapAddress,this->manager->rmapKey,1,transactionID,address+(written*4),count*4,writeBuffer+1);
manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(count*4) +1);
written+=count;
if(progress!=NULL)
@@ -128,22 +130,27 @@ unsigned int stardundeeSPW_USB::Read(uns
{
char requestBuffer[RMAP_READ_HEADER_MIN_SZ+1];
char* RMAP_AnswerBuffer;
- requestBuffer[0]=1;//Link number
+ requestBuffer[0]=this->manager->linkNumber;//Link number
int transactionID = 0;
int read=0;
QProgressBar* progress=NULL;
if(count>RMAP_MAX_XFER_SIZE)
progress= SocExplorerEngine::getProgressBar("Reading on SPW @0x"+QString::number(address,16)+" %v of "+QString::number(count)+" words ",count);
- SocExplorerEngine::message(this->plugin,QString("Enter read function, count=%1, RMAP_MAX_XFER_SIZE=%2").arg(count).arg(RMAP_MAX_XFER_SIZE));
+ SocExplorerEngine::message(this->plugin,QString("Enter read function, count=%1, RMAP_MAX_XFER_SIZE=%2").arg(count).arg(RMAP_MAX_XFER_SIZE),2);
//Quite stupide loop, I guess that I always get the number of byte I asked for!
while((int)count>=(int)RMAP_MAX_XFER_SIZE)
{
transactionID = manager->getRMAPtransactionID();
- SocExplorerEngine::message(this->plugin,QString("New transactionID:%1").arg(transactionID));
- RMAP_build_rx_request_header(254,2,1,transactionID,address+(read*4),RMAP_MAX_XFER_SIZE*4,requestBuffer+1);
+ SocExplorerEngine::message(this->plugin,QString("New transactionID:%1").arg(transactionID),2);
+ RMAP_build_rx_request_header(this->manager->rmapAddress,this->manager->rmapKey,1,transactionID,address+(read*4),RMAP_MAX_XFER_SIZE*4,requestBuffer+1);
manager->sendPacket(requestBuffer,RMAP_READ_HEADER_MIN_SZ+1);
int len=manager->getRMAPanswer(transactionID,&RMAP_AnswerBuffer);
+ if(len==-1)
+ {
+ this->toggleBridgeConnection();
+ return 0;
+ }
for(int i=0;i<((len-13)/4);i++)
{
Value[read+i] = 0x0FF & ((unsigned int)RMAP_AnswerBuffer[(4*i)+12]);
@@ -160,14 +167,19 @@ unsigned int stardundeeSPW_USB::Read(uns
if((int)count>0)
{
transactionID = manager->getRMAPtransactionID();
- SocExplorerEngine::message(this->plugin,QString("New transactionID: %1").arg(transactionID));
- SocExplorerEngine::message(this->plugin,QString("Building request with:"));
- SocExplorerEngine::message(this->plugin,QString("Address = %1").arg(address+(read*4),8,16));
- SocExplorerEngine::message(this->plugin,QString("Size = %1").arg(count*4));
- SocExplorerEngine::message(this->plugin,QString("Size + 13 = %1").arg((count*4)+13));
- RMAP_build_rx_request_header(254,2,1,transactionID,address+(read*4),count*4,requestBuffer+1);
+ SocExplorerEngine::message(this->plugin,QString("New transactionID: %1").arg(transactionID),2);
+ SocExplorerEngine::message(this->plugin,QString("Building request with:"),2);
+ SocExplorerEngine::message(this->plugin,QString("Address = %1").arg(address+(read*4),8,16),2);
+ SocExplorerEngine::message(this->plugin,QString("Size = %1").arg(count*4),2);
+ SocExplorerEngine::message(this->plugin,QString("Size + 13 = %1").arg((count*4)+13),2);
+ RMAP_build_rx_request_header(this->manager->rmapAddress,this->manager->rmapKey,1,transactionID,address+(read*4),count*4,requestBuffer+1);
manager->sendPacket(requestBuffer,RMAP_READ_HEADER_MIN_SZ+1);
int len=manager->getRMAPanswer(transactionID,&RMAP_AnswerBuffer);
+ if(len==-1)
+ {
+ this->toggleBridgeConnection();
+ return 0;
+ }
for(int i=0;i<((len-13)/4);i++)
{
Value[read+i] = 0x0FF & ((unsigned int)RMAP_AnswerBuffer[(4*i)+12]);
@@ -190,21 +202,68 @@ unsigned int stardundeeSPW_USB::Read(uns
return read;
}
-void stardundeeSPW_USB::updateAvailableBrickCount(int count)
+void stardundeeSPW_USB::brickSelectionChanged(int brickIndex)
+{
+ this->manager->selectedBrick = brickIndex-1;
+ SocExplorerEngine::message(plugin,QString("Changing brick index: %1").arg(manager->selectedBrick));
+}
+
+void stardundeeSPW_USB::linkNumberSelectionChanged(int linkIndex)
+{
+ this->manager->linkNumber = linkIndex + 1;
+ SocExplorerEngine::message(plugin,QString("Changing Link Number: %1").arg(manager->linkNumber));
+}
+
+void stardundeeSPW_USB::linkSpeedSelectionChanged(const QString &linkSpeed)
{
+ this->manager->linkSpeed = linkSpeed.toInt();
+ SocExplorerEngine::message(plugin,QString("Changing Link Speed: %1").arg(manager->linkSpeed));
+}
+
+void stardundeeSPW_USB::destinationKeyChanged(const QString &destKey)
+{
+ this->manager->destinationKey = destKey.toInt();
+ SocExplorerEngine::message(plugin,QString("Changing Destination Key: %1").arg(manager->destinationKey));
+}
+
+void stardundeeSPW_USB::rmapAddressChanged(const QString &rmapaddress)
+{
+ this->manager->rmapAddress = rmapaddress.toInt();
+ SocExplorerEngine::message(plugin,QString("Changing RMAP address: %1").arg(manager->rmapAddress));
+}
+
+void stardundeeSPW_USB::rmapKeyChanged(const QString &key)
+{
+ this->manager->rmapKey = key.toInt();
+ SocExplorerEngine::message(plugin,QString("Changing RMAP Key: %1").arg(manager->rmapKey));
}
void stardundeeSPW_USB::makeGUI(socexplorerplugin *parent)
{
- this->p_GUI = new StarDundeeGUI(plugin);
- this->mainLayout = new QGridLayout(this->p_GUI);
-// connect(this->connectBridgeButton,SIGNAL(clicked()),this,SLOT(toggleBridgeConnection()));
+ this->p_GUI = new StarDundeeGUI();
+// this->mainLayout = new QGridLayout(this->p_GUI);
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(connectClicked()),this,SLOT(toggleBridgeConnection()));
+ connect(this->manager,SIGNAL(updateAvailableBrickCount(int)),((StarDundeeGUI*)this->p_GUI),SLOT(updateAvailableBrickCount(int)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(brickSelectionChanged(int)),this,SLOT(brickSelectionChanged(int)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkNumberSelectionChanged(int)),this,SLOT(linkNumberSelectionChanged(int)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(linkSpeedSelectionChanged(QString)),this,SLOT(linkSpeedSelectionChanged(QString)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(destinationKeyChanged(QString)),this,SLOT(destinationKeyChanged(QString)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapAddressChanged(QString)),this,SLOT(rmapAddressChanged(QString)));
+ connect(((StarDundeeGUI*)this->p_GUI),SIGNAL(rmapKeyChanged(QString)),this,SLOT(rmapKeyChanged(QString)));
+ this->brickSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getBrickSelection());
+ this->linkNumberSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getLinkNumberSelection());
+ this->linkSpeedSelectionChanged(((StarDundeeGUI*)this->p_GUI)->getLinkSpeedSelection());
+ this->destinationKeyChanged(((StarDundeeGUI*)this->p_GUI)->getDestinationKey());
+ this->rmapAddressChanged(((StarDundeeGUI*)this->p_GUI)->getRmapAddress());
+ this->rmapKeyChanged(((StarDundeeGUI*)this->p_GUI)->getRmapKey());
+
}
stardundeeSPW_USB_Manager::stardundeeSPW_USB_Manager(socexplorerplugin *plugin, QObject *parent)
:QThread((QObject*)parent)
{
+ this->RMAPtimeout = 2000;
this->handleMutex = new QMutex(QMutex::NonRecursive);
this->RMAP_AnswersSem = new QSemaphore(0);
this->RMAP_AnswersMtx=new QMutex(QMutex::Recursive);
@@ -227,7 +286,7 @@ void stardundeeSPW_USB_Manager::run()
USB_SPACEWIRE_PACKET_PROPERTIES properties;
USB_SPACEWIRE_ID pIdentifier=NULL;
USB_SPACEWIRE_STATUS stat;
- SocExplorerEngine::message(this->plugin,"Starting Startdundee USB pooling thread");
+ SocExplorerEngine::message(this->plugin,"Starting Startdundee USB pooling thread",1);
char buffer[(RMAP_MAX_XFER_SIZE*4)+50];
while (!this->isInterruptionRequested())
{
@@ -237,20 +296,20 @@ void stardundeeSPW_USB_Manager::run()
//SocExplorerEngine::message(this->plugin,"Looking for new RMAP packets");
if(USBSpaceWire_WaitOnReadPacketAvailable(hDevice,0.01))
{
- SocExplorerEngine::message(this->plugin,"Got packet");
+ SocExplorerEngine::message(this->plugin,"Got packet",2);
stat = USBSpaceWire_ReadPackets(hDevice, buffer, (RMAP_MAX_XFER_SIZE*4)+50,1, 1, &properties, &pIdentifier);
if (stat == TRANSFER_SUCCESS)
{
if(USBSpaceWire_GetReadTrafficType(&properties, 0) ==SPACEWIRE_TRAFFIC_PACKET)
{
- SocExplorerEngine::message(this->plugin,"It's a SPW packet");
+ SocExplorerEngine::message(this->plugin,"It's a SPW packet",2);
if(USBSpaceWire_GetReadEOPStatus(&properties, 0)== SPACEWIRE_USB_EOP)
{
SocExplorerEngine::message(this->plugin,"Got end of packet");
if(buffer[1]==(char)SPW_PROTO_ID_RMAP) //RMAP packet
{
- SocExplorerEngine::message(this->plugin,"Got RMAP packet");
- SocExplorerEngine::message(this->plugin,QString("Rmap packet size %1").arg(properties.len));
+ SocExplorerEngine::message(this->plugin,"Got RMAP packet",2);
+ SocExplorerEngine::message(this->plugin,QString("Rmap packet size %1").arg(properties.len),2);
if(properties.len>8)
{
char* packetbuffer = (char*)malloc(properties.len);
@@ -277,12 +336,12 @@ void stardundeeSPW_USB_Manager::run()
{
USBSpaceWire_FreeRead(hDevice, pIdentifier);
handleMutex->unlock();
- SocExplorerEngine::message(this->plugin,"Got SPW packet");
+ SocExplorerEngine::message(this->plugin,"Got SPW packet",2);
}
}
else
{
- SocExplorerEngine::message(this->plugin,"No EOP received");
+ SocExplorerEngine::message(this->plugin,"No EOP received",2);
}
}
@@ -302,28 +361,30 @@ void stardundeeSPW_USB_Manager::run()
else
{
sleep(1);
- this->brickList = USBSpaceWire_ListDevices();
+ int list = USBSpaceWire_ListDevices();
+ if(this->brickList!=list)
+ {
+ this->brickList = list;
+ emit updateAvailableBrickCount(this->brickList);
+ }
}
usleep(1000);
}
- SocExplorerEngine::message(this->plugin,"Exiting Startdundee USB pooling thread");
+ SocExplorerEngine::message(this->plugin,"Exiting Startdundee USB pooling thread",1);
}
bool stardundeeSPW_USB_Manager::connectBridge()
{
- this->handleMutex->lock();
+ QMutexLocker mlock(this->handleMutex);
int status;
U32 statusControl;
- int brickNumber=0;
- int linkNumber=1;
this->connected = false;
- if (!USBSpaceWire_Open(&hDevice, brickNumber)) // Open the USB device
+ if (!USBSpaceWire_Open(&hDevice, this->selectedBrick)) // Open the USB device
{
- SocExplorerEngine::message(this->plugin,"stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
- this->handleMutex->unlock();
+ SocExplorerEngine::message(this->plugin,"stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))",0);
return false;
}
- SocExplorerEngine::message(this->plugin,"stardundee *** Open *** USBSpaceWire_Open successful");
+ SocExplorerEngine::message(this->plugin,"stardundee *** Open *** USBSpaceWire_Open successful",0);
USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
@@ -338,23 +399,23 @@ bool stardundeeSPW_USB_Manager::connectB
status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
if (status != CFG_TRANSFER_SUCCESS)
{
- SocExplorerEngine::message(this->plugin,"ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
+ SocExplorerEngine::message(this->plugin,"ERROR CFGSpaceWire_SetBrickBaseTransmitRate",1);
return false;
}
else
{
- SocExplorerEngine::message(this->plugin,"OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
+ SocExplorerEngine::message(this->plugin,"OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz",1);
}
// read the link status
- if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber, &statusControl) != CFG_TRANSFER_SUCCESS)
+ if (CFGSpaceWire_GetLinkStatusControl(hDevice, this->linkNumber, &statusControl) != CFG_TRANSFER_SUCCESS)
{
- SocExplorerEngine::message(this->plugin,"Could not read link status control for link " + QString::number(linkNumber));
+ SocExplorerEngine::message(this->plugin,"Could not read link status control for link " + QString::number(this->linkNumber),1);
return false;
}
else
{
- SocExplorerEngine::message(this->plugin,"OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber));
+ SocExplorerEngine::message(this->plugin,"OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(this->linkNumber),1);
// Set the link status control register properties
CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
@@ -364,35 +425,34 @@ bool stardundeeSPW_USB_Manager::connectB
CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
// Set the link status control register
- if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber, statusControl) != CFG_TRANSFER_SUCCESS)
+ if (CFGSpaceWire_SetLinkStatusControl(hDevice, this->linkNumber, statusControl) != CFG_TRANSFER_SUCCESS)
{
- SocExplorerEngine::message(this->plugin,"Could not set the link status control for link " + QString::number(linkNumber));
+ SocExplorerEngine::message(this->plugin,"Could not set the link status control for link " + QString::number(this->linkNumber),1);
return false;
}
else
{
- SocExplorerEngine::message(this->plugin,"Set the link status control for link " + QString::number(linkNumber));
+ SocExplorerEngine::message(this->plugin,"Set the link status control for link " + QString::number(this->linkNumber),1);
}
}
if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS)
{
- SocExplorerEngine::message(this->plugin,"Could not set the device to be an interface");
+ SocExplorerEngine::message(this->plugin,"Could not set the device to be an interface",1);
return false;
}
else
{
- SocExplorerEngine::message(this->plugin,"Device set to be an interface");
+ SocExplorerEngine::message(this->plugin,"Device set to be an interface",1);
}
USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
USBSpaceWire_SetTimeout(hDevice,1.0);
- SocExplorerEngine::message(this->plugin,"The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
- SocExplorerEngine::message(this->plugin,"The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes");
- SocExplorerEngine::message(this->plugin,"USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)));
+ SocExplorerEngine::message(this->plugin,"The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes",1);
+ SocExplorerEngine::message(this->plugin,"The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes",1);
+ SocExplorerEngine::message(this->plugin,"USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)),1);
this->connected = true;
- this->handleMutex->unlock();
return true;
}
@@ -400,9 +460,16 @@ bool stardundeeSPW_USB_Manager::disconne
{
this->handleMutex->lock();
USBSpaceWire_Close(hDevice); // Close the device
- SocExplorerEngine::message(this->plugin,"stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(0));
+ SocExplorerEngine::message(this->plugin,"stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(0),0);
USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports
this->handleMutex->unlock();
+ this->RMAP_pending_transaction_IDsMtx->lock();
+ this->RMAP_pending_transaction_IDs.clear();
+ this->RMAP_pending_transaction_IDsMtx->unlock();
+ this->RMAP_AnswersMtx->lock();
+ this->RMAP_Answers.clear();
+ this->RMAP_AnswersMtx->unlock();
+ this->RMAP_AnswersSem->acquire(this->RMAP_AnswersSem->available());
return true;
}
@@ -411,7 +478,7 @@ int stardundeeSPW_USB_Manager::getRMAPtr
this->RMAP_pending_transaction_IDsMtx->lock();
int ID=0;
bool found=true;
- while(ID<65536)
+ while(ID<511)
{
for(int i=0;iplugin,"Looking for RMAP answer",2);
+ timeout.start();
while (*buffer==NULL)
{
this->RMAP_AnswersMtx->lock();
+ SocExplorerEngine::message(this->plugin,"Got exclusive access on RMAP_Answers stack",2);
+ SocExplorerEngine::message(this->plugin,QString("%2 packet(s) available in RMAP_Answers stack").arg(RMAP_Answers.count()),2);
for(int i=0;itransactionID==transactionID)
{
this->RMAP_pending_transaction_IDsMtx->lock();
+ SocExplorerEngine::message(this->plugin,"Got exclusive access on RMAP_pending_transaction_ID stack",2);
for(int j=0;jRMAP_AnswersMtx->unlock();
//if no answer found in the stack wait until a new packet is pushed
- if(!buffer)
+ SocExplorerEngine::message(this->plugin,"waiting until a new packet is pushed",2);
+ if(*buffer==NULL)
{
- SocExplorerEngine::message(this->plugin,"waiting until a new packet is pushed");
+ while (0==this->RMAP_AnswersSem->available())
+ {
+ SocExplorerEngine::message(this->plugin,QString("this->RMAP_AnswersSem->available() = %1").arg(this->RMAP_AnswersSem->available()),2);
+ if(timeout.elapsed()>=RMAPtimeout)
+ {
+ SocExplorerEngine::message(this->plugin,"Timeout reached giving up!",2);
+ return -1;
+ }
+ usleep(1000);
+ }
this->RMAP_AnswersSem->acquire();
}
}
@@ -471,18 +554,18 @@ bool stardundeeSPW_USB_Manager::sendPack
{
USB_SPACEWIRE_STATUS result;
USB_SPACEWIRE_ID pIdentifier;
- SocExplorerEngine::message(this->plugin,"Sending SPW packet");
+ SocExplorerEngine::message(this->plugin,"Sending SPW packet",2);
this->handleMutex->lock();
result = USBSpaceWire_SendPacket(hDevice,packet,size,1, &pIdentifier);
if (result != TRANSFER_SUCCESS)
{
- SocExplorerEngine::message(this->plugin,"ERR sending the READ command ");
+ SocExplorerEngine::message(this->plugin,"ERR sending the READ command ",2);
this->handleMutex->unlock();
return false;
}
else
{
- SocExplorerEngine::message(this->plugin,"Packet sent");
+ SocExplorerEngine::message(this->plugin,"Packet sent",2);
USBSpaceWire_FreeSend(hDevice, pIdentifier);
}
this->handleMutex->unlock();
diff --git a/spwplugin/stardundeespw_usb.h b/spwplugin/stardundeespw_usb.h
--- a/spwplugin/stardundeespw_usb.h
+++ b/spwplugin/stardundeespw_usb.h
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------------
-- This file is a part of the SocExplorer Software
--- Copyright (C) 2014, Laboratory of Plasmas Physic - CNRS
+-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -62,6 +62,9 @@ public:
int getRMAPtransactionID();
int getRMAPanswer(int transactionID,char** buffer);
bool sendPacket(char* packet,int size);
+
+signals:
+ void updateAvailableBrickCount(int count);
private:
QMutex* handleMutex,*RMAP_AnswersMtx,*RMAP_pending_transaction_IDsMtx;
QSemaphore* RMAP_AnswersSem;
@@ -72,8 +75,16 @@ private:
char* SPWPacketBuff;
QList RMAP_Answers;
QList RMAP_pending_transaction_IDs;
+
+public:
+ int selectedBrick;
int linkNumber;
int brickList;
+ int linkSpeed;
+ int destinationKey;
+ int rmapAddress;
+ int rmapKey;
+ int RMAPtimeout;
};
class stardundeeSPW_USB : public abstractSpwBridge
@@ -92,13 +103,16 @@ public slots:
int pushRMAPPacket(char* packet,int size);
unsigned int Write(unsigned int *Value,unsigned int count, unsigned int address=0);
unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0);
- void updateAvailableBrickCount(int count);
+ void brickSelectionChanged(int brickIndex);
+ void linkNumberSelectionChanged(int linkIndex);
+ void linkSpeedSelectionChanged(const QString & linkSpeed);
+ void destinationKeyChanged(const QString & destKey);
+ void rmapAddressChanged(const QString & rmapaddress);
+ void rmapKeyChanged(const QString & key);
private:
void makeGUI(socexplorerplugin *parent);
stardundeeSPW_USB_Manager* manager;
- QGridLayout* mainLayout;
- QPushButton* connectBridgeButton;
- QComboBox* selectBrickQcmbx;
+// QGridLayout* mainLayout;
};
#endif // STARDUNDEESPW_USB_H