Skip to content

Instantly share code, notes, and snippets.

View mudgen's full-sized avatar

Nick Mudge mudgen

View GitHub Profile
public static final FormMeta SecsDefinitionFile =
new StringField(META, "SecsDefinitionFile",SFieldFlags.SMANDATORY).setDefault("").getFormMeta().
setCategory(Main).setEditorSource(FileUploadEditorSource.getSharedInstance());
public static final StringField SecsDefinitionFile =
new StringField(META, "SecsDefinitionFile",SFieldFlags.SMANDATORY).setDefault("");
static {
SecsDefinitionFile.getFormMeta().
setCategory(Main).setEditorSource(FileUploadEditorSource.getSharedInstance());
}
package com.inductiveautomation.gemsecs.webpages;
import java.util.List;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.wicket.Component;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.model.IModel;
package com.inductiveautomation.gemsecs.webpages;
import java.util.List;
import org.apache.wicket.Component;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.model.IModel;
import simpleorm.dataset.SRecordInstance;
package com.inductiveautomation.gemsecs;
import simpleorm.dataset.SFieldFlags;
//import com.inductiveautomation.gemsecs.EquipmentRecord.ConnectionMode;
import com.inductiveautomation.ignition.gateway.localdb.persistence.BooleanField;
import com.inductiveautomation.ignition.gateway.localdb.persistence.Category;
import com.inductiveautomation.ignition.gateway.localdb.persistence.EnumField;
import com.inductiveautomation.ignition.gateway.localdb.persistence.FormMeta;
import com.inductiveautomation.ignition.gateway.localdb.persistence.IdentityField;
package com.inductiveautomation.gemsecs.webpages;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import com.inductiveautomation.gemsecs.EquipmentRecord;
import com.inductiveautomation.ignition.gateway.localdb.persistence.RecordMeta;
import com.inductiveautomation.ignition.gateway.web.components.ConfigPanel;
import com.inductiveautomation.ignition.gateway.web.components.RecordActionTable;
{
"header": {
"doc": "Initialize Trace",
"stream": 2,
"function": 23,
"reply": true
},
"body": [
{
"doc": "Trace ID",
@mudgen
mudgen / layouts
Created July 29, 2013 20:28
Customizing component layouts
from com.inductiveautomation.factorypmi.application.components.util import FPMILayout
layout = component.getClientProperty(FPMILayout.LAYOUT_CONSTRAINTS)
layout.setFlags(FPMILayout.ANCHOR_N | FPMILayout.ANCHOR_E | FPMILayout.ANCHOR_W | FPMILayout.ANCHOR_S)
#Here is how to get the designer bounds from the client. Works for any container. Maybe it works for components. Does not work for windows so use the rootContainer.
r = FPMILayout.getPreferredBounds(system.gui.getParentWindow(event).rootContainer)
width, height = int(r.width), int(r.height)
@mudgen
mudgen / anchored_size_calculations
Created July 29, 2013 20:31
Get 0 width of anchored layout component Get x of anchored layout component Get actual width of anchored layout component
container = event.source.parent
componentZeroWidth = -(container.width - container.designerWidth)
componentX = component.x - (container.width - container.designerWidth)
componentWidth = component.width - (container.width - container.designerWidth)
componentHeight = component.height - (container.height - container.designerHeight)
@mudgen
mudgen / right_click_menu
Created July 29, 2013 23:33
Right click menu popup functionality
def getDirectoryPopup(event):
from com.inductiveautomation.ignition.client.images import PathIcon
from java.awt import Insets,Dimension,FlowLayout,Component,BorderLayout
from javax.swing import SwingConstants,JMenuItem,BorderFactory,JPopupMenu,JLabel
tree = event.source
selItem = tree.selectedItem
selPath = tree.selectedPath
def addRecipe(event):
app.directories.addRecipe(tree)