Created
November 20, 2012 17:05
-
-
Save mudgen/4119292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| import com.inductiveautomation.ignition.gateway.localdb.persistence.IntField; | |
| import com.inductiveautomation.ignition.gateway.localdb.persistence.PersistentRecord; | |
| import com.inductiveautomation.ignition.gateway.localdb.persistence.RecordMeta; | |
| import com.inductiveautomation.ignition.gateway.localdb.persistence.StringField; | |
| import com.inductiveautomation.ignition.gateway.web.components.editors.FileUploadEditorSource; | |
| public class EquipmentRecord extends PersistentRecord { | |
| public static final RecordMeta<EquipmentRecord> META = | |
| new RecordMeta<EquipmentRecord>(EquipmentRecord.class, "EquipmentRecord"); | |
| public static final IdentityField Id = new IdentityField(META); | |
| public static final StringField Name = | |
| new StringField(META, "Name", SFieldFlags.SMANDATORY, | |
| SFieldFlags.SDESCRIPTIVE); | |
| public static final StringField Description = | |
| new StringField(META, "Description",SFieldFlags.SDESCRIPTIVE); | |
| public static final StringField ActiveIpAddress = | |
| new StringField(META, "ActiveIpAddress"); | |
| public static final IntField ActivePort = | |
| new IntField(META, "ActivePort"); | |
| public static final StringField PassiveIpAddress = | |
| new StringField(META, "PassiveIpAddress"); | |
| public static final IntField PassivePort = | |
| new IntField(META, "PassivePort"); | |
| public static final IntField DeviceId = | |
| new IntField(META, "DeviceId"); | |
| enum ConnectionMode { | |
| ACTIVE,PASSIVE,ALTERNATING | |
| } | |
| public static final EnumField<ConnectionMode> Mode = | |
| new EnumField<ConnectionMode>(META, "ConnectionMode", ConnectionMode.class, SFieldFlags.SMANDATORY).setDefault(ConnectionMode.ACTIVE); | |
| public static final IntField T3Timeout = | |
| new IntField(META, "T3Timeout").setDefault(45); | |
| public static final IntField T5Timeout = | |
| new IntField(META, "T5Timeout").setDefault(10); | |
| public static final IntField T6Timeout = | |
| new IntField(META, "T6Timeout").setDefault(5); | |
| public static final IntField T7Timeout = | |
| new IntField(META, "T7Timeout").setDefault(10); | |
| public static final IntField T8Timeout = | |
| new IntField(META, "T8Timeout").setDefault(5); | |
| public static final IntField KeepAliveTimeout = | |
| new IntField(META, "KeepAliveTimeout").setDefault(0); | |
| static final Category Main = new Category("EquipmentRecord.Category.Main", 0).include(Name, Description, ActiveIpAddress, ActivePort, | |
| PassiveIpAddress, PassivePort, DeviceId, Mode); | |
| static final Category Timeouts = new Category("EquipmentRecord.Category.Timeouts", 1, true).include(T3Timeout,T5Timeout,T6Timeout,T7Timeout, | |
| T8Timeout,KeepAliveTimeout); | |
| public static final StringField SecsDefinitionFile = | |
| new StringField(META, "SecsDefinitionFile",SFieldFlags.SMANDATORY).setDefault(""); | |
| static { | |
| SecsDefinitionFile.getFormMeta().setCategory(Main).setEditorSource(FileUploadEditorSource.getSharedInstance()); | |
| } | |
| @Override | |
| public RecordMeta<?> getMeta() { | |
| return META; | |
| } | |
| public Long getId(){ | |
| return getLong(Id); | |
| } | |
| public String getName(){ | |
| return getString(Name); | |
| } | |
| public void setName(String name){ | |
| setString(Name,name); | |
| } | |
| /* | |
| public String getActiveIPAddress() { | |
| return getString(ActiveIPAddress); | |
| } | |
| public void setActiveIPAddress(String ipAddress) { | |
| setString(ActiveIPAddress, ipAddress); | |
| } | |
| */ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment